We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eb520c0 commit fa9d159Copy full SHA for fa9d159
new/docs/typescript/1.ts
@@ -65,4 +65,22 @@ type ElementOf<T> = T extends Array<infer E> ? E : T;
65
type avava = ElementOf<string []>
66
type adada = ElementOf<number []>
67
type booleanadada = ElementOf<boolean []>
68
-type boolea21nadada = ElementOf<{name: string}>
+type boolea21nadada = ElementOf<{name: string}>
69
+
70
71
+function p(): Promise<{data: any [], code: number, msg: string | undefined}> {
72
+ return new Promise((resolve, reject) => {
73
+ setTimeout(() => {
74
+ resolve({data: [], code: 200, msg: 'success'})
75
+ }, 1000 * 3);
76
77
+ })
78
+}
79
80
+p().then(result => {
81
82
+})
83
84
+let str1 = 'abc';
85
+// str1 = 'cna'
86
+ <boolean>str1 = false
0 commit comments