notebooklm-api 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/LICENSE +21 -0
- package/README.md +113 -0
- package/dist/api/artifacts.d.ts +155 -0
- package/dist/api/artifacts.d.ts.map +1 -0
- package/dist/api/chat.d.ts +63 -0
- package/dist/api/chat.d.ts.map +1 -0
- package/dist/api/notebooks.d.ts +91 -0
- package/dist/api/notebooks.d.ts.map +1 -0
- package/dist/api/notes.d.ts +56 -0
- package/dist/api/notes.d.ts.map +1 -0
- package/dist/api/research.d.ts +63 -0
- package/dist/api/research.d.ts.map +1 -0
- package/dist/api/sources.d.ts +136 -0
- package/dist/api/sources.d.ts.map +1 -0
- package/dist/auth.d.ts +82 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/cli/commands/chat.d.ts +7 -0
- package/dist/cli/commands/chat.d.ts.map +1 -0
- package/dist/cli/commands/generate.d.ts +6 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/login.d.ts +8 -0
- package/dist/cli/commands/login.d.ts.map +1 -0
- package/dist/cli/commands/notebook.d.ts +8 -0
- package/dist/cli/commands/notebook.d.ts.map +1 -0
- package/dist/cli/commands/research.d.ts +6 -0
- package/dist/cli/commands/research.d.ts.map +1 -0
- package/dist/cli/commands/source.d.ts +6 -0
- package/dist/cli/commands/source.d.ts.map +1 -0
- package/dist/cli/helpers.d.ts +55 -0
- package/dist/cli/helpers.d.ts.map +1 -0
- package/dist/cli/index.d.ts +8 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +18930 -0
- package/dist/client.d.ts +134 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/core.d.ts +65 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/errors.d.ts +68 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15519 -0
- package/dist/logger.d.ts +28 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/paths.d.ts +36 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/rpc/decoder.d.ts +81 -0
- package/dist/rpc/decoder.d.ts.map +1 -0
- package/dist/rpc/encoder.d.ts +48 -0
- package/dist/rpc/encoder.d.ts.map +1 -0
- package/dist/rpc/index.d.ts +7 -0
- package/dist/rpc/index.d.ts.map +1 -0
- package/dist/rpc/types.d.ts +148 -0
- package/dist/rpc/types.d.ts.map +1 -0
- package/dist/types.d.ts +226 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sources API Module
|
|
3
|
+
*
|
|
4
|
+
* Handles source document management for notebooks.
|
|
5
|
+
*/
|
|
6
|
+
import { ClientCore } from '../core.ts';
|
|
7
|
+
import type { Source, SourceFulltext, SourceGuide } from '../types.ts';
|
|
8
|
+
/**
|
|
9
|
+
* API client for source operations.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SourcesAPI {
|
|
12
|
+
private core;
|
|
13
|
+
constructor(core: ClientCore);
|
|
14
|
+
/**
|
|
15
|
+
* Lists all sources in a notebook.
|
|
16
|
+
*
|
|
17
|
+
* @param notebookId - The notebook ID
|
|
18
|
+
* @returns List of sources
|
|
19
|
+
*/
|
|
20
|
+
list(notebookId: string): Promise<Source[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Gets details for a specific source.
|
|
23
|
+
*
|
|
24
|
+
* @param notebookId - The notebook ID
|
|
25
|
+
* @param sourceId - The source ID
|
|
26
|
+
* @returns Source details
|
|
27
|
+
*/
|
|
28
|
+
get(notebookId: string, sourceId: string): Promise<Source>;
|
|
29
|
+
/**
|
|
30
|
+
* Adds a URL source to a notebook.
|
|
31
|
+
* Automatically detects YouTube URLs.
|
|
32
|
+
*
|
|
33
|
+
* @param notebookId - The notebook ID
|
|
34
|
+
* @param url - The URL to add
|
|
35
|
+
* @returns The created source
|
|
36
|
+
*/
|
|
37
|
+
addUrl(notebookId: string, url: string): Promise<Source>;
|
|
38
|
+
/**
|
|
39
|
+
* Adds copied text as a source.
|
|
40
|
+
*
|
|
41
|
+
* @param notebookId - The notebook ID
|
|
42
|
+
* @param title - Title for the text source
|
|
43
|
+
* @param content - The text content
|
|
44
|
+
* @returns The created source
|
|
45
|
+
*/
|
|
46
|
+
addText(notebookId: string, title: string, content: string): Promise<Source>;
|
|
47
|
+
/**
|
|
48
|
+
* Uploads a file as a source.
|
|
49
|
+
*
|
|
50
|
+
* @param notebookId - The notebook ID
|
|
51
|
+
* @param filename - The filename
|
|
52
|
+
* @param content - File content as bytes
|
|
53
|
+
* @param contentType - MIME type of the file
|
|
54
|
+
* @returns The created source
|
|
55
|
+
*/
|
|
56
|
+
addFile(notebookId: string, filename: string, content: Uint8Array, contentType: string): Promise<Source>;
|
|
57
|
+
/**
|
|
58
|
+
* Adds a Google Drive document as a source.
|
|
59
|
+
*
|
|
60
|
+
* @param notebookId - The notebook ID
|
|
61
|
+
* @param driveId - The Drive document ID
|
|
62
|
+
* @returns The created source
|
|
63
|
+
*/
|
|
64
|
+
addDrive(notebookId: string, driveId: string): Promise<Source>;
|
|
65
|
+
/**
|
|
66
|
+
* Deletes a source from a notebook.
|
|
67
|
+
*
|
|
68
|
+
* @param notebookId - The notebook ID
|
|
69
|
+
* @param sourceId - The source ID to delete
|
|
70
|
+
*/
|
|
71
|
+
delete(notebookId: string, sourceId: string): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Renames a source.
|
|
74
|
+
*
|
|
75
|
+
* @param notebookId - The notebook ID
|
|
76
|
+
* @param sourceId - The source ID
|
|
77
|
+
* @param newTitle - The new title
|
|
78
|
+
*/
|
|
79
|
+
rename(notebookId: string, sourceId: string, newTitle: string): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Refreshes content for a URL or Drive source.
|
|
82
|
+
*
|
|
83
|
+
* @param notebookId - The notebook ID
|
|
84
|
+
* @param sourceId - The source ID
|
|
85
|
+
*/
|
|
86
|
+
refresh(notebookId: string, sourceId: string): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Waits for a source to finish processing.
|
|
89
|
+
*
|
|
90
|
+
* @param notebookId - The notebook ID
|
|
91
|
+
* @param sourceId - The source ID
|
|
92
|
+
* @param options - Polling options
|
|
93
|
+
* @returns The processed source
|
|
94
|
+
*/
|
|
95
|
+
waitUntilReady(notebookId: string, sourceId: string, options?: {
|
|
96
|
+
timeoutMs?: number;
|
|
97
|
+
pollIntervalMs?: number;
|
|
98
|
+
}): Promise<Source>;
|
|
99
|
+
/**
|
|
100
|
+
* Waits for multiple sources to be ready.
|
|
101
|
+
*
|
|
102
|
+
* @param notebookId - The notebook ID
|
|
103
|
+
* @param sourceIds - List of source IDs
|
|
104
|
+
* @param options - Polling options
|
|
105
|
+
* @returns List of processed sources
|
|
106
|
+
*/
|
|
107
|
+
waitForSources(notebookId: string, sourceIds: string[], options?: {
|
|
108
|
+
timeoutMs?: number;
|
|
109
|
+
pollIntervalMs?: number;
|
|
110
|
+
}): Promise<Source[]>;
|
|
111
|
+
/**
|
|
112
|
+
* Gets the AI-generated guide for a source.
|
|
113
|
+
*
|
|
114
|
+
* @param notebookId - The notebook ID
|
|
115
|
+
* @param sourceId - The source ID
|
|
116
|
+
* @returns Source guide with summary and keywords
|
|
117
|
+
*/
|
|
118
|
+
getGuide(notebookId: string, sourceId: string): Promise<SourceGuide>;
|
|
119
|
+
/**
|
|
120
|
+
* Gets the full indexed text content of a source.
|
|
121
|
+
*
|
|
122
|
+
* @param notebookId - The notebook ID
|
|
123
|
+
* @param sourceId - The source ID
|
|
124
|
+
* @returns Full text content with sections
|
|
125
|
+
*/
|
|
126
|
+
getFulltext(notebookId: string, sourceId: string): Promise<SourceFulltext>;
|
|
127
|
+
/**
|
|
128
|
+
* Checks if a source needs refreshing based on its age.
|
|
129
|
+
*
|
|
130
|
+
* @param source - The source to check
|
|
131
|
+
* @param maxAgeMs - Maximum age in milliseconds (default 24 hours)
|
|
132
|
+
* @returns Whether the source should be refreshed
|
|
133
|
+
*/
|
|
134
|
+
checkFreshness(source: Source, maxAgeMs?: number): boolean;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../src/api/sources.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAQxC,OAAO,KAAK,EAAE,MAAM,EAAc,cAAc,EAAE,WAAW,EAAiB,MAAM,aAAa,CAAC;AAoBlG;;GAEG;AACH,qBAAa,UAAU;IACT,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAEpC;;;;;OAKG;IACG,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAQjD;;;;;;OAMG;IACG,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAWhE;;;;;;;OAOG;IACG,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAY9D;;;;;;;OAOG;IACG,OAAO,CACX,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC;IAYlB;;;;;;;;OAQG;IACG,OAAO,CACX,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,UAAU,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC;IAoBlB;;;;;;OAMG;IACG,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAcpE;;;;;OAKG;IACG,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMjE;;;;;;OAMG;IACG,MAAM,CACV,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;IAUhB;;;;;OAKG;IACG,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMlE;;;;;;;OAOG;IACG,cAAc,CAClB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;KACpB,GACL,OAAO,CAAC,MAAM,CAAC;IAmClB;;;;;;;OAOG;IACG,cAAc,CAClB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EAAE,EACnB,OAAO,GAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;KACpB,GACL,OAAO,CAAC,MAAM,EAAE,CAAC;IAMpB;;;;;;OAMG;IACG,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAW1E;;;;;;OAMG;IACG,WAAW,CACf,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,cAAc,CAAC;IAW1B;;;;;;OAMG;IACH,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,SAAW,GAAG,OAAO;CAI7D"}
|
package/dist/auth.d.ts
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authentication Module for NotebookLM Client
|
|
3
|
+
*
|
|
4
|
+
* Handles loading cookies from Playwright storage state and
|
|
5
|
+
* extracting CSRF/Session tokens from the NotebookLM homepage.
|
|
6
|
+
*/
|
|
7
|
+
import type { Cookie } from './types.ts';
|
|
8
|
+
/**
|
|
9
|
+
* Playwright storage state format
|
|
10
|
+
*/
|
|
11
|
+
interface StorageState {
|
|
12
|
+
cookies: PlaywrightCookie[];
|
|
13
|
+
origins?: unknown[];
|
|
14
|
+
}
|
|
15
|
+
interface PlaywrightCookie {
|
|
16
|
+
name: string;
|
|
17
|
+
value: string;
|
|
18
|
+
domain: string;
|
|
19
|
+
path: string;
|
|
20
|
+
expires: number;
|
|
21
|
+
httpOnly: boolean;
|
|
22
|
+
secure: boolean;
|
|
23
|
+
sameSite: 'Strict' | 'Lax' | 'None';
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Authentication tokens for API requests
|
|
27
|
+
*/
|
|
28
|
+
export declare class AuthTokens {
|
|
29
|
+
cookies: Cookie[];
|
|
30
|
+
csrfToken: string;
|
|
31
|
+
sessionId: string;
|
|
32
|
+
constructor(cookies: Cookie[], csrfToken: string, sessionId: string);
|
|
33
|
+
/**
|
|
34
|
+
* Creates AuthTokens from a Playwright storage state file.
|
|
35
|
+
*
|
|
36
|
+
* This is the recommended initialization method.
|
|
37
|
+
*/
|
|
38
|
+
static fromStorage(storagePath?: string): Promise<AuthTokens>;
|
|
39
|
+
/**
|
|
40
|
+
* Creates AuthTokens from a parsed storage state object.
|
|
41
|
+
*/
|
|
42
|
+
static fromStorageState(storageState: StorageState): Promise<AuthTokens>;
|
|
43
|
+
/**
|
|
44
|
+
* Returns cookies as a header string for fetch requests.
|
|
45
|
+
*/
|
|
46
|
+
getCookieHeader(): string;
|
|
47
|
+
/**
|
|
48
|
+
* Checks if the tokens appear to be valid.
|
|
49
|
+
*/
|
|
50
|
+
isValid(): boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Extracts and filters cookies from Playwright storage state.
|
|
54
|
+
*
|
|
55
|
+
* Uses domain whitelist and priority rules to ensure deterministic behavior.
|
|
56
|
+
*/
|
|
57
|
+
export declare function extractCookiesFromStorage(storageState: StorageState): Cookie[];
|
|
58
|
+
/**
|
|
59
|
+
* Fetches CSRF and session tokens from the NotebookLM homepage.
|
|
60
|
+
*
|
|
61
|
+
* These tokens are embedded in the page HTML and required for API calls.
|
|
62
|
+
*/
|
|
63
|
+
export declare function fetchTokens(cookies: Cookie[]): Promise<{
|
|
64
|
+
csrfToken: string;
|
|
65
|
+
sessionId: string;
|
|
66
|
+
}>;
|
|
67
|
+
/**
|
|
68
|
+
* Creates an httpx-compatible cookie jar for downloads.
|
|
69
|
+
* Preserves domain information for cross-domain redirects.
|
|
70
|
+
*/
|
|
71
|
+
export declare function createCookieJar(cookies: Cookie[]): Map<string, string>;
|
|
72
|
+
/**
|
|
73
|
+
* Refreshes authentication tokens.
|
|
74
|
+
*
|
|
75
|
+
* This helps prevent "Session Expired" errors by obtaining fresh tokens.
|
|
76
|
+
*/
|
|
77
|
+
export declare function refreshTokens(cookies: Cookie[]): Promise<{
|
|
78
|
+
csrfToken: string;
|
|
79
|
+
sessionId: string;
|
|
80
|
+
}>;
|
|
81
|
+
export {};
|
|
82
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAqBzC;;GAEG;AACH,UAAU,YAAY;IACpB,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;CACrB;AAED,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAA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MAAM,WAAW,SACc,CAAC;AAmDvC,eAAO,MAAM,UAAU,SAyCnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/generate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,eAAO,MAAM,eAAe,SAES,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/login.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwBpC,eAAO,MAAM,YAAY,SAiFrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/notebook.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,eAAO,MAAM,eAAe,SACM,CAAC;AAkJnC,eAAO,MAAM,aAAa,SAiBtB,CAAC;AAGL,eAAO,MAAM,WAAW,SAiCpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"research.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/research.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,eAAO,MAAM,eAAe,SACe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/source.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAepC,eAAO,MAAM,aAAa,SACe,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Helper Functions
|
|
3
|
+
*/
|
|
4
|
+
import { NotebookLMClient } from '../client.ts';
|
|
5
|
+
/**
|
|
6
|
+
* Gets a configured client, handling auth errors gracefully.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getClient(storagePath?: string): Promise<NotebookLMClient>;
|
|
9
|
+
/**
|
|
10
|
+
* Formats a date for display.
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatDate(date: Date): string;
|
|
13
|
+
/**
|
|
14
|
+
* Formats a duration in milliseconds.
|
|
15
|
+
*/
|
|
16
|
+
export declare function formatDuration(ms: number): string;
|
|
17
|
+
/**
|
|
18
|
+
* Truncates a string to a maximum length.
|
|
19
|
+
*/
|
|
20
|
+
export declare function truncate(str: string, maxLen: number): string;
|
|
21
|
+
/**
|
|
22
|
+
* Prints a success message.
|
|
23
|
+
*/
|
|
24
|
+
export declare function success(message: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* Prints an error message.
|
|
27
|
+
*/
|
|
28
|
+
export declare function error(message: string): void;
|
|
29
|
+
/**
|
|
30
|
+
* Prints an info message.
|
|
31
|
+
*/
|
|
32
|
+
export declare function info(message: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* Prints a warning message.
|
|
35
|
+
*/
|
|
36
|
+
export declare function warn(message: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* Creates a simple table from data.
|
|
39
|
+
*/
|
|
40
|
+
export declare function table(headers: string[], rows: string[][], columnWidths?: number[]): void;
|
|
41
|
+
/**
|
|
42
|
+
* Spinner for long operations.
|
|
43
|
+
*/
|
|
44
|
+
export declare class Spinner {
|
|
45
|
+
private interval;
|
|
46
|
+
private frames;
|
|
47
|
+
private frameIndex;
|
|
48
|
+
private message;
|
|
49
|
+
constructor(message: string);
|
|
50
|
+
start(): void;
|
|
51
|
+
stop(finalMessage?: string): void;
|
|
52
|
+
succeed(message?: string): void;
|
|
53
|
+
fail(message?: string): void;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL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