Add test files
This commit is contained in:
52
test/fixtures/test-types.ts
vendored
Normal file
52
test/fixtures/test-types.ts
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
export interface User {
|
||||
id: number;
|
||||
name: string;
|
||||
email: string;
|
||||
createdAt: Date;
|
||||
}
|
||||
|
||||
export interface Admin extends User {
|
||||
permissions: string[];
|
||||
role: 'admin' | 'superadmin';
|
||||
}
|
||||
|
||||
export type UserId = number | string;
|
||||
|
||||
export type AdminResponse = {
|
||||
user: Admin;
|
||||
token: string;
|
||||
};
|
||||
|
||||
export type ApiResponse<T> = {
|
||||
data: T;
|
||||
status: number;
|
||||
message: string;
|
||||
};
|
||||
|
||||
export interface Session {
|
||||
id: string;
|
||||
userId: UserId;
|
||||
expiresAt: Date;
|
||||
}
|
||||
|
||||
export enum Status {
|
||||
Pending = 'pending',
|
||||
Active = 'active',
|
||||
Inactive = 'inactive'
|
||||
}
|
||||
|
||||
export type ComplexType = {
|
||||
nested: {
|
||||
deep: {
|
||||
value: string;
|
||||
};
|
||||
};
|
||||
union: 'a' | 'b' | 'c' | 'd' | 'e' | 'f';
|
||||
intersection: User & { extra: string };
|
||||
};
|
||||
|
||||
export type ConditionalType<T> = T extends string ? 'string' : T extends number ? 'number' : 'unknown';
|
||||
|
||||
export type DeepPartial<T> = {
|
||||
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
||||
};
|
||||
Reference in New Issue
Block a user