-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtype-interface.ts
More file actions
42 lines (41 loc) · 867 Bytes
/
type-interface.ts
File metadata and controls
42 lines (41 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// string
//number
//array
//object
//any
//boolean
//unknown
//const assertion - never - void
// type alias - interface
//create - delete - edit - read
type TUser = {
id: number;
name: string;
};
type UserDto = {
name: string;
};
type FilterUser = {
id?: number;
name?: string;
};
interface IUser {
create(data: UserDto): void;
delete(id: number): void;
read(filter: FilterUser): TUser[];
update(id: number, user: UserDto): void;
}
class User implements IUser {
create(data: UserDto): void {
throw new Error("Method not implemented.");
}
delete(id: number): void {
throw new Error("Method not implemented.");
}
read(filter: FilterUser): TUser[] {
throw new Error("Method not implemented.");
}
update(id: number, user: UserDto): void {
throw new Error("Method not implemented.");
}
}