UNPKG

php-wasm

Version:

Run PHP right in the browser or anywhere else JS can run

42 lines (39 loc) • 2.62 kB
// Generated by bin/generate-runtime-types.mjs. import type { PhpBaseModuleFactory, PhpRuntimeFactory, PhpRuntimeArgs, PhpRuntimeVersion, PhpRuntimeValue, PhpTemplateValue, PhpBinaryRuntime, PhpPathAnalysis, PhpFileNode, PhpFileStat, PhpReadFileOptions, PhpReadDirectoryOptions, PhpDirectoryEntry } from './public.d.ts'; export type * from './public.d.ts'; export declare class PhpBase<RunArgs extends unknown[] = [phpCode: string], RefreshResult = number, RunResult = number> extends EventTarget { constructor(phpBinLoader: Promise<PhpBaseModuleFactory | PhpRuntimeFactory>, args?: PhpRuntimeArgs, sapi?: string, phpSettings?: PhpRuntimeArgs); autoTransaction: boolean; transactionStarted: boolean | Promise<void>; phpVersion?: PhpRuntimeVersion; phpArgs: PhpRuntimeArgs; queue: Array<[Function, Array<string | number | boolean | object | undefined>, (value?: PhpRuntimeValue) => void, (reason?: object | string | number | boolean | Error) => void, boolean?]>; binary: Promise<PhpBinaryRuntime>; onerror: (event?: Event) => void; onoutput: (event?: Event) => void; onready: (event?: Event) => void; inputString(byteString: string): void; input(items: Iterable<number>): void; flush(): void; tokenize(phpCode: string): Promise<string>; startTransaction(): Promise<void>; commitTransaction(readOnly?: boolean): Promise<void>; run(...args: RunArgs): Promise<RunResult>; exec(phpCode: string): Promise<PhpRuntimeValue>; x(fragments: TemplateStringsArray, ...values: PhpTemplateValue[]): Promise<PhpRuntimeValue>; r(fragments: TemplateStringsArray, ...values: PhpTemplateValue[]): Promise<RunResult>; refresh(): Promise<RefreshResult>; analyzePath(path: string): Promise<PhpPathAnalysis>; readdir(path: string, options?: PhpReadDirectoryOptions & { withFileTypes?: false }): Promise<string[]>; readdir(path: string, options: PhpReadDirectoryOptions & { withFileTypes: true }): Promise<PhpDirectoryEntry[]>; readdir(path: string, options?: PhpReadDirectoryOptions): Promise<string[] | PhpDirectoryEntry[]>; readFile(path: string, options: PhpReadFileOptions & { encoding: 'utf8' }): Promise<string>; readFile(path: string, options?: PhpReadFileOptions & { encoding?: 'binary' }): Promise<Uint8Array>; readFile(path: string, options?: PhpReadFileOptions): Promise<string | Uint8Array>; stat(path: string): Promise<PhpFileStat>; mkdir(path: string): Promise<PhpFileNode>; rmdir(path: string): Promise<void>; rename(path: string, newPath: string): Promise<void>; writeFile(path: string, data: string | ArrayBufferView, options?: object): Promise<void>; unlink(path: string): Promise<void>; }