import { ScramjetFrame } from "../controller/frame"; import { type URLMeta } from "../shared/rewriters/url"; import { CookieStore } from "../shared/cookie"; import { SingletonBox } from "./singletonbox"; import BareClient from "@mercuryworkshop/bare-mux"; type NativeStore = { store: Record; call: (target: string, that: any, ...args: any[]) => any; construct: (target: string, ...args: any[]) => any; }; type DescriptorStore = { store: Record; get: (target: string, that: any) => any; set: (target: string, that: any, value: any) => void; }; export type AnyFunction = Function; export type ScramjetModule = { enabled: (client: ScramjetClient) => boolean | undefined; disabled: (client: ScramjetClient, self: typeof globalThis) => void | undefined; order: number | undefined; default: (client: ScramjetClient, self: typeof globalThis) => void; }; export type ProxyCtx = { fn: AnyFunction; this: any; args: any[]; newTarget: AnyFunction; return: (r: any) => void; call: () => any; }; export type Proxy = { construct?(ctx: ProxyCtx): any; apply?(ctx: ProxyCtx): any; }; export type TrapCtx = { this: any; get: () => T; set: (v: T) => void; }; export type Trap = { writable?: boolean; value?: any; enumerable?: boolean; configurable?: boolean; get?: (ctx: TrapCtx) => T; set?: (ctx: TrapCtx, v: T) => void; }; export declare class ScramjetClient { global: typeof globalThis; locationProxy: any; serviceWorker: ServiceWorkerContainer; bare: BareClient; natives: NativeStore; descriptors: DescriptorStore; wrapfn: (i: any, ...args: any) => any; cookieStore: CookieStore; eventcallbacks: Map; meta: URLMeta; box: SingletonBox; constructor(global: typeof globalThis); get frame(): ScramjetFrame | null; get isSubframe(): boolean; loadcookies(cookiestr: string): void; hook(): void; get url(): URL; set url(url: URL | string); Proxy(name: string | string[], handler: Proxy): void; RawProxy(target: any, prop: string, handler: Proxy): void; Trap(name: string | string[], descriptor: Trap): PropertyDescriptor; RawTrap(target: any, prop: string, descriptor: Trap): PropertyDescriptor; } export {};