export declare type ParseOptions = { fixNulls: boolean; }; export declare type AccessModifier = 'public' | 'protected' | 'private'; export declare type PHPObjectPropertyInfo = { accessModifier: AccessModifier; propertyName: string; }; export declare function parse(input: string, options?: Partial): PHPTypes.PHPCustomObject | PHPTypes.PHPObject | PHPTypes.PHPReference | PHPTypes.PHPString | PHPTypes.PHPArray | { length: number; value: null; toJs(): null; } | { length: number; value: boolean; toJs(): boolean; } | { length: number; value: number; toJs(): number; }; export declare function toJs(object: PHPTypes.AllTypes, options?: Partial, seen?: WeakMap): PHPTypes.ValueTypes; export declare function parseFixedLengthString(input: string, openingDelimiter?: string, closingDelimiter?: string): [string, number]; export declare function makeRegExpClass(regex: RegExp, valueParser: (input: string) => T): { new (length: number, value: T): { length: number; value: T; toJs(): T; }; build(input: string): { length: number; value: T; toJs(): T; }; toJs(instance: { length: number; value: T; toJs(): T; }): T; }; export declare namespace PHPTypes { export type PHPReferenceIdentifier = 'R' | 'r'; export class PHPReference { length: number; value: AllTypes; static regex: RegExp; constructor(length: number, value: AllTypes); static build(input: string): PHPReference; toJs(options?: Partial): ValueTypes; static toJs(instance: PHPReference, options?: Partial): ValueTypes; } export type PHPBooleanIdentifier = 'b'; const PHPBoolean_base: { new (length: number, value: boolean): { length: number; value: boolean; toJs(): boolean; }; build(input: string): { length: number; value: boolean; toJs(): boolean; }; toJs(instance: { length: number; value: boolean; toJs(): boolean; }): boolean; }; export class PHPBoolean extends PHPBoolean_base { } export type PHPFloatIdentifier = 'd'; const PHPFloat_base: { new (length: number, value: number): { length: number; value: number; toJs(): number; }; build(input: string): { length: number; value: number; toJs(): number; }; toJs(instance: { length: number; value: number; toJs(): number; }): number; }; export class PHPFloat extends PHPFloat_base { } export type PHPIntegerIdentifier = 'i'; const PHPInteger_base: { new (length: number, value: number): { length: number; value: number; toJs(): number; }; build(input: string): { length: number; value: number; toJs(): number; }; toJs(instance: { length: number; value: number; toJs(): number; }): number; }; export class PHPInteger extends PHPInteger_base { } export type PHPNullIdentifier = 'N'; const PHPNull_base: { new (length: number, value: null): { length: number; value: null; toJs(): null; }; build(input: string): { length: number; value: null; toJs(): null; }; toJs(instance: { length: number; value: null; toJs(): null; }): null; }; export class PHPNull extends PHPNull_base { constructor(); } export type PHPCustomObjectIdentifier = 'C'; export class PHPCustomObject { length: number; value: string; className: string; static regex: RegExp; constructor(length: number, value: string, className: string); static build(input: string): PHPCustomObject; toJs(): string; static toJs(instance: PHPCustomObject): string; } export abstract class MappedData { static mapRegex: RegExp; static parseMap(input: string, openingDelimiter?: string, closingDelimiter?: string): [Map, number]; } export type PHPObjectIdentifier = 'O'; export class PHPObject extends MappedData { length: number; value: Map; className: string; static regex: RegExp; constructor(length: number, value: Map, className: string); static build(input: string): PHPObject; protected jsValue: Record>; toJs(options?: Partial): Record; static propertyInfo(propertyName: string, className: string): PHPObjectPropertyInfo; static toJs(instance: PHPObject, options?: Partial): Record; } export type PHPArrayIdentifier = 'a'; export class PHPArray extends MappedData { length: number; value: Map; static regex: RegExp; constructor(length: number, value: Map); static build(input: string): PHPArray; protected jsValue: Record)>; toJs(options?: Partial): ValueTypes[] | Record; static toJs(instance: PHPArray, options?: Partial): AllTypes[] | Record; } export type PHPStringIdentifier = 's'; export class PHPString { length: number; value: string; static regex: RegExp; constructor(length: number, value: string); static build(input: string): PHPString; toJs(): string; static toJs(instance: PHPString): string; } export type AllTypes = PHPCustomObject | PHPNull | PHPObject | PHPReference | PHPString | PHPArray | PHPBoolean | PHPFloat | PHPInteger; export type AllTypeClasses = typeof PHPCustomObject | typeof PHPNull | typeof PHPObject | typeof PHPReference | typeof PHPString | typeof PHPArray | typeof PHPBoolean | typeof PHPFloat | typeof PHPInteger; export type ValueTypes = { [key in string | number]: ValueTypes; } | ValueTypes[] | PHPCustomObject['value'] | PHPNull['value'] | PHPString['value'] | PHPBoolean['value'] | PHPFloat['value'] | PHPInteger['value']; export type Identifiers = PHPCustomObjectIdentifier | PHPNullIdentifier | PHPObjectIdentifier | PHPReferenceIdentifier | PHPStringIdentifier | PHPArrayIdentifier | PHPBooleanIdentifier | PHPFloatIdentifier | PHPIntegerIdentifier; export const identifierMap: { C: typeof PHPCustomObject; N: typeof PHPNull; O: typeof PHPObject; R: typeof PHPReference; S: typeof PHPString; a: typeof PHPArray; b: typeof PHPBoolean; d: typeof PHPFloat; i: typeof PHPInteger; r: typeof PHPReference; s: typeof PHPString; }; export type ToJsOptions = { private: boolean; detectArrays: boolean; }; export {}; }