Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/src/util/vs/base-common.d.ts
13397 views
1
//!!! DO NOT modify, this file was COPIED from 'microsoft/vscode'
2
3
/*---------------------------------------------------------------------------------------------
4
* Copyright (c) Microsoft Corporation. All rights reserved.
5
* Licensed under the MIT License. See License.txt in the project root for license information.
6
*--------------------------------------------------------------------------------------------*/
7
8
// Declare types that we probe for to implement util and/or polyfill functions
9
10
declare global {
11
12
// --- idle callbacks
13
14
interface IdleDeadline {
15
readonly didTimeout: boolean;
16
timeRemaining(): number;
17
}
18
19
function requestIdleCallback(callback: (args: IdleDeadline) => void, options?: { timeout: number }): number;
20
function cancelIdleCallback(handle: number): void;
21
22
23
// --- timeout / interval (available in all contexts, but different signatures in node.js vs web)
24
25
interface TimeoutHandle { readonly _: never; /* this is a trick that seems needed to prevent direct number assignment */ }
26
type Timeout = TimeoutHandle;
27
function setTimeout(handler: string | Function, timeout?: number, ...arguments: any[]): Timeout;
28
function clearTimeout(timeout: Timeout | undefined): void;
29
30
function setInterval(callback: (...args: any[]) => void, delay?: number, ...args: any[]): Timeout;
31
function clearInterval(timeout: Timeout | undefined): void;
32
33
34
// --- error
35
36
interface ErrorConstructor {
37
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
38
stackTraceLimit: number;
39
}
40
}
41
42
export { }
43
44