---
source: crates/oxc_codegen/tests/integration/ts.rs
---
let x: string = `\x01`;
let x: string = `\x01`;

function foo<T extends string>(x: T, y: string, ...restOfParams: Omit<T, 'x'>): T {
	return x;
}
function foo<T extends string>(x: T, y: string, ...restOfParams: Omit<T, 'x'>): T {
	return x;
}

let x: string[] = ['abc', 'def', 'ghi'];
let x: string[] = ['abc', 'def', 'ghi'];

let x: Array<string> = ['abc', 'def', 'ghi',];
let x: Array<string> = ['abc', 'def', 'ghi',];

let x: [string, number] = ['abc', 123];
let x: [string, number] = ['abc', 123];

let x: string | number = 'abc';
let x: string | number = 'abc';

let x: string & number = 'abc';
let x: string & number = 'abc';

let x: typeof String = 'string';
let x: typeof String = 'string';

let x: keyof string = 'length';
let x: keyof string = 'length';

let x: keyof typeof String = 'length';
let x: keyof typeof String = 'length';

let x: string['length'] = 123;
let x: string['length'] = 123;

function isString(value: unknown): asserts value is string {
            if (typeof value !== 'string') {
                throw new Error('Not a string');
            }
        }
function isString(value: unknown): asserts value is string {
	if (typeof value !== 'string') {
		throw new Error('Not a string');
	}
}

import type { Foo } from 'foo';
import type { Foo } from 'foo';

import { Foo, type Bar } from 'foo';
import { Foo, type Bar } from 'foo';

export { Foo, type Bar } from 'foo';
export { Foo, type Bar } from 'foo';

type A<T> = { [K in keyof T as K extends string ? B<K> : K ]: T[K] }
type A<T> = { [K in keyof T as K extends string ? B<K> : K] : T[K]};

class A {readonly type = 'frame'}
class A {
	readonly type = 'frame';
}

let foo: { <T>(t: T): void }
let foo: {<T>(t: T): void};

let foo: { new <T>(t: T): void }
let foo: {new <T>(t: T): void};

function <const T>(){}
function<const T>() {}

class A {m?(): void}
class A {
	m?(): void;
}

class A {constructor(public readonly a: number) {}}
class A {
	constructor(public readonly a: number) {}
}

abstract class A {private abstract static m() {}}
abstract class A {
	private abstract static m() {}
}

abstract class A {private abstract static readonly prop: string}
abstract class A {
	private abstract static readonly prop: string;
}
