Ir al contenido principal

@php-wasm/universal

Index

References

SpawnedPHP

Renames and re-exports AcquiredPHP

WithAPIState

Renames and re-exports WithIsReady

Type Aliases

DataModule

DataModule: { default: (phpRuntime: PHPRuntime) => void; dependenciesTotalSize: number; dependencyFilename: string }

Type declaration

  • default: (phpRuntime: PHPRuntime) => void
  • dependenciesTotalSize: number
  • dependencyFilename: string

EmscriptenOptions

EmscriptenOptions: { ENV?: Record<string, string>; debug?: boolean; instantiateWasm?: (info: WebAssembly.Imports, receiveInstance: (instance: WebAssembly.Instance, module: WebAssembly.Module) => void) => void; locateFile?: (path: string) => string; monitorRunDependencies?: (left: number) => void; noInitialRun?: boolean; onAbort?: (message: string) => void; onMessage?: (listener: EmscriptenMessageListener) => void; onRuntimeInitialized?: (phpRuntime: PHPRuntime) => void; outboundNetworkProxyServer?: Server<typeof IncomingMessage, typeof ServerResponse>; print?: (message: string) => void; printErr?: (message: string) => void; quit?: (status: number, toThrow: any) => void } & Record<string, any>

FileNotFoundAction

FileNotFoundAction: FileNotFoundToResponse | FileNotFoundToInternalRedirect | FileNotFoundTo404

FileNotFoundGetActionCallback

FileNotFoundGetActionCallback: (relativePath: string) => FileNotFoundAction

Type declaration

FileNotFoundToInternalRedirect

FileNotFoundToInternalRedirect: { type: internal-redirect; uri: string }

Type declaration

  • type: internal-redirect
  • uri: string

FileNotFoundToResponse

FileNotFoundToResponse: { response: PHPResponse; type: response }

Type declaration

HTTPMethod

HTTPMethod: GET | POST | HEAD | OPTIONS | PATCH | PUT | DELETE

IterateFilesOptions

IterateFilesOptions: { exceptPaths?: string[]; pathPrefix?: string; relativePaths?: boolean }

Type declaration

  • optionalexceptPaths?: string[]

    A list of paths to exclude from the results.

  • optionalpathPrefix?: string

    A prefix to add to all paths. Only used if relativePaths is true.

  • optionalrelativePaths?: boolean

    Should yield paths relative to the root directory? If false, all paths will be absolute.

MessageListener

MessageListener: (data: string) => Promise<string | Uint8Array | void> | string | void

Type declaration

    • (data: string): Promise<string | Uint8Array | void> | string | void
    • Parameters

      • data: string

      Returns Promise<string | Uint8Array | void> | string | void

MountHandler

MountHandler: (php: PHP, FS: Emscripten.RootFS, vfsMountPoint: string) => UnmountFunction | Promise<UnmountFunction>

Type declaration

PHPEvent

PHPEvent: PHPRequestEndEvent | PHPRequestErrorEvent | PHPRuntimeInitializedEvent | PHPRuntimeBeforeExitEvent | PHPFilesystemWriteEvent

Represents an event related to the PHP instance. This is intentionally not an extension of CustomEvent to make it isomorphic between different JavaScript runtimes.

PHPEventListener

PHPEventListener: (event: PHPEvent) => void

A callback function that handles PHP events.


Type declaration

PHPFactory

PHPFactory: (options: PHPFactoryOptions) => Promise<PHP>

Type declaration

PHPFactoryOptions

PHPFactoryOptions: { isPrimary: boolean }

Type declaration

  • isPrimary: boolean

PHPLoaderModule

PHPLoaderModule: { dependenciesTotalSize: number; dependencyFilename: string; init: (jsRuntime: string, options: EmscriptenOptions) => PHPRuntime }

Type declaration

PHPRequestHandlerConfiguration

PHPRequestHandlerConfiguration: BaseConfiguration & { cookieStore?: CookieStore | false; maxPhpInstances?: number; php?: PHP; phpFactory?: (requestHandler: PHPRequestHandlerFactoryArgs) => Promise<PHP> }

PHPRequestHeaders

PHPRequestHeaders: Record<string, string>

PHPRuntime

PHPRuntime: any

PHPRuntimeId

PHPRuntimeId: number

PublicAPI

PublicAPI<Methods, PipedAPI>: RemoteAPI<Methods & PipedAPI>

Type parameters

  • Methods
  • PipedAPI = unknown

Remote

Remote<T>: RemoteObject<T> & (T extends (...args: infer TArguments) => infer TReturn ? (...args: { [ I in keyof TArguments ]: UnproxyOrClone<TArguments[I]> }) => Promisify<ProxyOrClone<Unpromisify<TReturn>>> : unknown) & (T extends new (...args: TArguments) => TInstance ? new (...args: { [ I in string | number | symbol ]: UnproxyOrClone<TArguments[I<I>]> }) => Promisify<Remote<TInstance>> : unknown) & ProxyMethods

Takes the raw type of a remote object, function or class in the other thread and returns the type as it is visible to the local thread from the proxy return value of Comlink.wrap() or Comlink.proxy().


Type parameters

  • T

RemoteAPI

RemoteAPI<T>: Remote<T> & WithAPIState

Type parameters

  • T

RewriteRule

RewriteRule: { match: RegExp; replacement: string }

Type declaration

  • match: RegExp
  • replacement: string

RuntimeType

RuntimeType: NODE | WEB | WORKER

SpawnHandler

SpawnHandler: (command: string, args: string[]) => ChildProcess

Type declaration

    • (command: string, args: string[]): ChildProcess
    • Parameters

      • command: string
      • args: string[]

      Returns ChildProcess

SupportedPHPVersion

SupportedPHPVersion: typeof SupportedPHPVersions[number]

UniversalPHP

UniversalPHP: LimitedPHPApi | Remote<LimitedPHPApi>

UnmountFunction

UnmountFunction: () => Promise<any> | () => any

WithIsReady

WithIsReady: { isConnected: () => Promise<void>; isReady: () => Promise<void> }

Type declaration

  • isConnected: () => Promise<void>

    Resolves to true when the remote API is ready for Comlink communication, but not necessarily fully initialized yet.

      • (): Promise<void>
      • Returns Promise<void>

  • isReady: () => Promise<void>

    Resolves to true when the remote API is declares it's fully loaded and ready to be used.

      • (): Promise<void>
      • Returns Promise<void>

Variables

constDEFAULT_BASE_URL

DEFAULT_BASE_URL: http://example.com = 'http://example.com'

The default base used to convert a path into the URL object.

constLatestSupportedPHPVersion

LatestSupportedPHPVersion: 8.5 = ...

constSupportedPHPVersions

SupportedPHPVersions: readonly [8.5, 8.4, 8.3, 8.2, 8.1, 8.0, 7.4, 7.3, 7.2] = ...

constSupportedPHPVersionsList

SupportedPHPVersionsList: string[] = ...

const__private__dont__use

__private__dont__use: typeof __private__dont__use = ...