-
Notifications
You must be signed in to change notification settings - Fork 10
/
typescript.d.ts
73 lines (64 loc) · 1.28 KB
/
typescript.d.ts
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* This file is generated and managed by tsync */
/** Doc comments are preserved too! */
type Book = BookType & {
/** Name of the book. */
name: string;
/** Chapters of the book. */
chapters: Array<Chapter>;
/**
* Reviews of the book
* by users.
*/
user_reviews?: Array<string>;
}
/** Book struct with camelCase field names. */
interface BookCamel {
/** Name of the book. */
name: string;
/** Chapters of the book. */
chapters: Array<Chapter>;
/**
* Reviews of the book
* by users.
*/
userReviews?: Array<string>;
}
/**
* Multiple line comments
* are formatted on
* separate lines
*/
interface Chapter {
title: string;
pages: number;
}
/** Generic struct test */
interface PaginationResult<T> {
items: Array<T>;
total_items: number;
}
/** Generic struct test with camelCase field names. */
interface PaginationResultCamel<T> {
items: Array<T>;
totalItems: number;
}
/** Struct with flattened field. */
type Author = AuthorName & {
name: string;
}
interface AuthorName {
alias?: string;
first_name: string;
last_name: string;
}
type BookType =
| BookType__Fiction
| BookType__NonFiction;
type BookType__Fiction = {
type: "Fiction";
genre: string;
};
type BookType__NonFiction = {
type: "NonFiction";
subject: string;
};