import { SandboxKey, ProxyTarget } from "@locker/shared"; import { GlobalObject } from "@locker/shared-dom"; import { SandboxRecord as SandboxRecordBase } from "@locker/shared-dom"; import { ApiOptions, Instrumentation } from "@locker/instrumentation"; type AttributeChangedCallbackArgs = [ string, ...any ]; declare const enum CookieSameSite { "strict" = 0, "lax" = 1, "none" = 2 } type CookieListItem = { name: string; value: string; domain?: string; path: string; expires?: number; secure: boolean; sameSite: CookieSameSite; }; interface CustomElementConstructor { formAssociated?: boolean; observedAttributes?: string[]; new (...params: any[]): HTMLElement; } type CustomElementRegistryPerKey = Map; type Distortion = ProxyTarget; type DistortionFactory = (record: SandboxRecord) => DistortionFactoryEntry; type DistortionFactoryEntry = DistortionMapEntry | void; type DistortionFactoryInitializer = (record: SandboxRecord) => DistortionFactory; type DistortionFunction = CallableFunction | NewableFunction; type DistortionMap = WeakMap; type DistortionMapEntry = readonly [ ProxyTarget, Distortion ]; type HTMLElementConstructor = typeof HTMLElement; type NodeNameMapSetNamedItem = (attr: Attr) => Attr | null; interface PropertyDescriptorRegistry { [key: PropertyKey]: PropertyDescriptor | null; } interface PivotDefinition { LocalCtor: CustomElementConstructor; PivotCtor: CustomElementConstructor | undefined; formAssociated: boolean; observedAttributes: string[] | undefined; observedAttributesAsSet: Set | undefined; adoptedCallback: (() => void) | undefined; attributeChangedCallback: ((name: string, oldValue: any, newValue: any) => void) | undefined; connectedCallback: (() => void) | undefined; disconnectedCallback: (() => void) | undefined; formAssociatedCallback: ((form: HTMLFormElement | null) => void) | undefined; formDisabledCallback: ((disabled: boolean) => void) | undefined; formResetCallback: (() => void) | undefined; formStateRestoreCallback: ((state: string | FormData | File, reason: "autocomplete" | "restore") => void) | undefined; } type PropertyDescriptorRegistryMap = WeakMap; interface SandboxRecord extends SandboxRecordBase { BASIC_INSTRUMENTATION_DATA: ApiOptions; distortions: DistortionMap; instrumentation: Instrumentation; key: SandboxKey; root: SandboxRecord; } declare const enum SandboxType { External = 0, Internal = 1 } interface StorageMeta { namespace: string; storage: Storage; } interface VirtualCustomElementRegistry { applyDefine(cer: CustomElementRegistry, args: Parameters): void; applyGet(cer: CustomElementRegistry, args: Parameters): ReturnType; applyUpgrade(cer: CustomElementRegistry, args: Parameters): ReturnType; applyWhenDefined: (cer: CustomElementRegistry, args: Parameters) => WhenDefinedResult; getDefinition: (instance: HTMLElement) => PivotDefinition | undefined; newCtor: (instance: HTMLElement, newTarget: any, originalCtor: HTMLElementConstructor) => HTMLElement; scheduleConnectedCallback: (instance: HTMLElement, tagName: string) => void; scheduleDisconnectedCallback: (instance: HTMLElement, tagName: string) => void; scheduleOrUpgrade: (instance: HTMLElement, tagName: string, originalDefinition: PivotDefinition) => void; setDefinition: (instance: HTMLElement, pivotDefinition: PivotDefinition) => void; upgrade: (instance: HTMLElement, originalDefinition: PivotDefinition, pivotDefinition: PivotDefinition) => void; } type WhenDefinedResult = Promise; declare function patchGlobalObject(globalObject: GlobalObject, /* istanbul ignore next: function is never called without a document */ document?: Document): void; // istanbul ignore next: dead code to be kept until 248 declare function unpatchGlobalObject(globalObject: GlobalObject, document?: Document): void; declare const DataTransferProtoBlockedProperties: readonly string[]; declare const internalDistortionFactoryInitializers: readonly DistortionFactoryInitializer[]; declare const internalKeyedDistortionFactoryInitializers: readonly DistortionFactoryInitializer[]; declare const externalDistortionFactoryInitializers: readonly DistortionFactoryInitializer[]; declare const externalKeyedDistortionFactoryInitializers: readonly DistortionFactoryInitializer[]; declare const distortionFactoryInitializerToggleSwitches: Map; declare const DocumentBlockedProperties: readonly string[]; declare const DocumentProtoBlockedProperties: readonly string[]; declare function finalizeAttributeDistortions(record: SandboxRecord): void; declare const ElementProtoBlockedProperties: readonly string[]; declare const EventProtoBlockedProperties: readonly string[]; declare const HTMLElementBlockedAttributes: readonly string[]; declare const HTMLElementProtoBlockedProperties: readonly string[]; declare const HTMLEmbedElementProtoBlockedProperties: readonly string[]; // https://www.w3schools.com/tags/tag_iframe.asp declare const HTMLIFrameElementBlockedAttributes: readonly string[]; declare const HTMLIFrameElementProtoBlockedProperties: readonly string[]; declare const HTMLObjectElementProtoBlockedProperties: readonly string[]; declare const HTMLScriptElementBlockedAttributes: readonly string[]; declare const HTMLScriptElementProtoBlockedProperties: readonly string[]; declare const SVGElementBlockedAttributes: readonly string[]; declare const SVGElementProtoBlockedProperties: readonly string[]; declare const UIEventProtoBlockedProperties: readonly string[]; declare function addBlockedAttributeDistortionFactoryInitializers(Ctor: any, ctorName: string, attributes: string[] | readonly string[], factoryInitializers: DistortionFactoryInitializer[]): void; declare function addBlockedPropertyDistortionFactoryInitializers({ document }: SandboxRecord, proto: any, properties: PropertyKey[] | readonly PropertyKey[], factoryInitializers: DistortionFactoryInitializer[]): void; declare const WindowBlockedProperties: readonly string[]; declare function initDistortionWindowPostMessage({ globalObject: { postMessage: originalPostMessage } }: SandboxRecord): DistortionFactory; declare const XSLTProcessorProtoBlockedProperties: readonly string[]; export { patchGlobalObject, unpatchGlobalObject, DataTransferProtoBlockedProperties, distortionFactoryInitializerToggleSwitches, externalDistortionFactoryInitializers, externalKeyedDistortionFactoryInitializers, internalDistortionFactoryInitializers, internalKeyedDistortionFactoryInitializers, DocumentBlockedProperties, DocumentProtoBlockedProperties, finalizeAttributeDistortions, ElementProtoBlockedProperties, EventProtoBlockedProperties, HTMLElementBlockedAttributes, HTMLElementProtoBlockedProperties, HTMLEmbedElementProtoBlockedProperties, HTMLIFrameElementBlockedAttributes, HTMLIFrameElementProtoBlockedProperties, HTMLObjectElementProtoBlockedProperties, HTMLScriptElementBlockedAttributes, HTMLScriptElementProtoBlockedProperties, SVGElementBlockedAttributes, SVGElementProtoBlockedProperties, AttributeChangedCallbackArgs, CookieSameSite, CookieListItem, CustomElementConstructor, CustomElementRegistryPerKey, Distortion, DistortionFactory, DistortionFactoryEntry, DistortionFactoryInitializer, DistortionFunction, DistortionMap, DistortionMapEntry, HTMLElementConstructor, NodeNameMapSetNamedItem, PropertyDescriptorRegistry, PivotDefinition, PropertyDescriptorRegistryMap, SandboxRecord, SandboxType, StorageMeta, VirtualCustomElementRegistry, WhenDefinedResult, UIEventProtoBlockedProperties, addBlockedAttributeDistortionFactoryInitializers, addBlockedPropertyDistortionFactoryInitializers, WindowBlockedProperties, initDistortionWindowPostMessage, XSLTProcessorProtoBlockedProperties }; //# sourceMappingURL=index.cjs.d.ts.map