Repository navigation
Expand file tree
/
Copy pathPHPObject.d.ts
More file actions
54 lines (54 loc) · 1.7 KB
/
Copy pathPHPObject.d.ts
File metadata and controls
54 lines (54 loc) · 1.7 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import type { PHPContext } from "../PHPContext.js";
export interface PHPParameterMetadata {
name: string;
position: number;
isOptional: boolean;
hasDefault: boolean;
defaultValue?: any;
type?: string;
byref?: boolean;
}
export interface PHPPropertyMetadata {
name: string;
visibility: "public" | "protected" | "private";
isStatic: boolean;
isReadOnly: boolean;
defaultValue?: any;
}
export interface PHPMethodMetadata {
name: string;
visibility: "public" | "protected" | "private";
isStatic: boolean;
isAbstract: boolean;
isFinal: boolean;
numberOfParameters: number;
numberOfRequiredParameters: number;
parameters: PHPParameterMetadata[];
fn: Function;
}
export declare class PHPClass {
readonly name: string;
readonly parentClass?: PHPClass;
nativeConstructor?: Function;
readonly interfaces: PHPClass[];
readonly traits: any[];
constants: Record<string, any>;
staticProperties: Record<string, any>;
properties: Record<string, PHPPropertyMetadata>;
methods: Record<string, PHPMethodMetadata>;
isAbstract: boolean;
isFinal: boolean;
constructor(name: string, parentClass?: PHPClass | Function);
isSubclassOf(className: string): boolean;
}
export declare class PHPObject {
readonly phpClass: PHPClass;
properties: Record<string, any>;
private settingProperties;
private gettingProperties;
constructor(phpClass: PHPClass);
getProperty(ctx: PHPContext, name: string): Promise<any>;
setProperty(ctx: PHPContext, name: string, value: any): Promise<void>;
callMethod(ctx: PHPContext, name: string, args: any[]): Promise<any>;
toString(ctx: PHPContext): Promise<string>;
}