Repository navigation
Expand file tree
/
Copy pathStreams.d.ts
More file actions
34 lines (34 loc) · 1.88 KB
/
Copy pathStreams.d.ts
File metadata and controls
34 lines (34 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import * as fs from "fs/promises";
import type { PHPEngine } from "../PHPEngine.js";
import type { PHPContext } from "../PHPContext.js";
import { PHPReference } from "./PHPVariable.js";
export declare class PHPStreamContext {
options: Record<string, any>;
constructor(options?: Record<string, any>);
}
export interface PHPFileStream {
handle: fs.FileHandle;
isResource: boolean;
}
export declare class StreamRuntime {
static stream_context_create(ctx: PHPContext | null, optionsArg?: PHPReference): Promise<PHPStreamContext>;
static fopen(ctx: PHPContext, filenameArg?: PHPReference, modeArg?: PHPReference): Promise<PHPFileStream | false>;
static fclose(ctx: PHPContext | null, streamArg?: PHPReference): Promise<boolean>;
static fread(ctx: PHPContext | null, streamArg?: PHPReference, lengthArg?: PHPReference): Promise<string | false>;
static fwrite(ctx: PHPContext | null, streamArg?: PHPReference, dataArg?: PHPReference, lengthArg?: PHPReference): Promise<number | false>;
static stream_get_contents(ctx: PHPContext | null, streamArg?: PHPReference, maxLengthArg?: PHPReference, offsetArg?: PHPReference): Promise<string | false>;
static stream_get_wrappers(ctx?: PHPContext): Promise<string[]>;
static stream_is_local(ctx: PHPContext | null, streamArg?: PHPReference): Promise<boolean>;
static functions: {
fopen: typeof StreamRuntime.fopen;
fclose: typeof StreamRuntime.fclose;
fread: typeof StreamRuntime.fread;
fwrite: typeof StreamRuntime.fwrite;
fputs: typeof StreamRuntime.fwrite;
stream_context_create: typeof StreamRuntime.stream_context_create;
stream_get_contents: typeof StreamRuntime.stream_get_contents;
stream_get_wrappers: typeof StreamRuntime.stream_get_wrappers;
stream_is_local: typeof StreamRuntime.stream_is_local;
};
static register(engine: PHPEngine): void;
}