mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-28 17:41:54 +08:00
Perf: further speed up infra
This commit is contained in:
36
Build/mod.d.ts
vendored
Normal file
36
Build/mod.d.ts
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
declare module 'gorhill-publicsuffixlist' {
|
||||
type Selfie =
|
||||
| string
|
||||
| {
|
||||
magic: number;
|
||||
buf32: number[];
|
||||
};
|
||||
interface Decoder {
|
||||
decode: (bufferStr: string, buffer: ArrayBuffer) => void;
|
||||
decodeSize: (bufferStr: string) => number;
|
||||
}
|
||||
interface Encoder {
|
||||
encode: (buffer: ArrayBuffer, length: number) => string;
|
||||
}
|
||||
export interface PublicSuffixList {
|
||||
version: string;
|
||||
|
||||
parse(text: string, toAscii: (input: string) => string): void;
|
||||
|
||||
getPublicSuffix(hostname: string): string;
|
||||
getDomain(hostname: string): string;
|
||||
|
||||
suffixInPSL(hostname: string): boolean;
|
||||
|
||||
toSelfie(encoder?: null | Encoder): Selfie;
|
||||
fromSelfie(selfie: Selfie, decoder?: null | Decoder): boolean;
|
||||
|
||||
enableWASM(options?: {
|
||||
customFetch?: null | ((url: URL) => Promise<Blob>);
|
||||
}): Promise<boolean>;
|
||||
disableWASM(): Promise<boolean>;
|
||||
}
|
||||
|
||||
const psl: PublicSuffixList;
|
||||
export default psl;
|
||||
}
|
||||
Reference in New Issue
Block a user