forked from denoland/doc_website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.ts
105 lines (89 loc) · 2.17 KB
/
test.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
export { fizz, buzz as renamedBuzz } from "./bar.ts"
export * from "./bar.ts";
export * as barNamespace from "./bar.ts";
/** Something about fizzBuzz */
export const fizzBuzz: string = "fizzBuzz";
/**
* Complicated function
*/
export function diagnostics(a: Promise<string>, b: () => Record<string, string>): Promise<[DiagnosticItem[] | undefined, Record<string, string>]> {
};
/**
* Hello there, this is a multiline JSdoc.
*
* It has many lines
*
* Or not that many?
*/
export function foo(a: string, b: number): void {
console.log("Hello world");
}
/** This is single line JSdoc */
export function bar(a: string, b: number): void {
console.log("Hello world");
}
/** Class doc */
export class Foobar extends Fizz implements Buzz {
private private1: boolean;
/** Js doc for protected1 */
protected protected1: number;
public public1: boolean;
/**
* Js doc for public2
*
* Foobar
*
* Foo
*/
public2: number;
/** Constructor js doc */
constructor(name: string, private private2: number, protected protected2: number) {}
/** Async foo method */
async foo(): Promise<void> {
//
}
/** Sync bar method */
bar(): void {
//
}
}
/**
* Interface js doc
*/
export interface Reader {
/** Read n bytes */
read(buf: Uint8Array, something: unknown): Promise<number>
}
/** Array holding numbers */
export type NumberArray = Array<number>;
export type OperatingSystem = "mac" | "win" | "linux";
export type Arch = "x64" | "arm64";
export type BuildInfo = OperatingSystem | Arch;
export type ReadonlyArray<T> = Array<T>;
/**
* Some enum for good measure
*/
export enum Hello {
World = "world",
Fizz = "fizz",
Buzz = "buzz",
}
/** Root namespace JSdoc */
export namespace Deno {
/** Export var JSdoc */
export var x = 1;
/**
* Nested namespace JSdoc
*/
export namespace Nested {
/** nestedConst JSdoc */
export const nestedConst = "a";
}
/** Nested.Deeply namespace JSdoc */
export namespace Nested.Deeply {
/**
* nestedDeeplyConst JSdoc
*/
export const nestedDeeplyConst = "a";
}
}