forked from googleapis/cloud-trace-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
60 lines (58 loc) · 1.92 KB
/
types.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
// Copyright 2017 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
declare namespace NodeJS {
export interface Global {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
_google_trace_agent: any;
}
export interface Process {
_preload_modules: string[];
}
export namespace Module {
// According to https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19612,
// NodeModule will be removed in favor of NodeJS.Module.
// Currently, neither depends on the other, though NodeJS.Module's interface is
// a superset of NodeModule.
function _resolveFilename(
request: string,
parent?: Module | NodeModule
): string;
function _load(
request: string,
parent?: Module | NodeModule,
isMain?: boolean
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): any;
function _resolveLookupPaths(
request: string,
parent?: Module | NodeModule
): string;
}
}
declare module 'require-in-the-middle' {
namespace hook {
type Options = {
internals?: boolean;
};
type OnRequireFn = <T>(exports: T, name: string, basedir?: string) => T;
}
function hook(
modules: string[] | null,
options: hook.Options | null,
onRequire: hook.OnRequireFn
): void;
function hook(modules: string[] | null, onRequire: hook.OnRequireFn): void;
function hook(onRequire: hook.OnRequireFn): void;
export = hook;
}