import { IFrameProtocol } from './iframe-protocol'; import { Dependencies, SandpackBundlerFiles, BundlerState, ModuleError, ClientStatus } from './types'; export interface ClientOptions { /** * Location of the bundler. */ bundlerURL?: string; /** * Width of iframe. */ width?: string; /** * Height of iframe. */ height?: string; /** * If we should skip the third step: evaluation. */ skipEval?: boolean; /** * Boolean flags to trigger certain UI elements in the bundler */ showOpenInCodeSandbox?: boolean; showErrorScreen?: boolean; showLoadingScreen?: boolean; /** * You can pass a custom file resolver that is responsible for resolving files. * We will use this to get all files from the file system. */ fileResolver?: { isFile: (path: string) => Promise; readFile: (path: string) => Promise; }; } export interface SandboxInfo { files: SandpackBundlerFiles; dependencies?: Dependencies; entry?: string; /** * What template we use, if not defined we infer the template from the dependencies or files. * * @type {string} */ template?: string; /** * Only use unpkg for fetching the dependencies, no preprocessing. It's slower, but doesn't talk * to AWS. */ disableDependencyPreprocessing?: boolean; } export declare class SandpackClient { selector: string | undefined; element: Element; iframe: HTMLIFrameElement; iframeProtocol: IFrameProtocol; options: ClientOptions; bundlerURL: string; bundlerState?: BundlerState; errors: Array; status: ClientStatus; sandboxInfo: SandboxInfo; unsubscribeGlobalListener: Function; unsubscribeChannelListener: Function; constructor(selector: string | HTMLIFrameElement, sandboxInfo: SandboxInfo, options?: ClientOptions); cleanup(): void; updateOptions(options: ClientOptions): void; updatePreview(sandboxInfo?: SandboxInfo, isInitializationCompile?: boolean): void; dispatch(message: Object): void; listen(listener: (msg: any) => void): Function; /** * Get the URL of the contents of the current sandbox */ getCodeSandboxURL(): Promise<{ sandboxId: string; editorUrl: string; embedUrl: string; }>; getTranspilerContext: () => Promise<{ [transpiler: string]: Object; }>; private getFiles; private initializeElement; }