DefinitelyTyped/types/php-serialize/index.d.ts
Changhui Lee e665d7c49f Add types for php-serialize (#40869)
* Add type definitions for 'php-serialize'

* Modifying tscconfig.json to the guidelines

* Add missing type definitions header

* Add test file into tsconfig

* Fix typing and remove unused variable declaration

* Fix optional function parameters

* Add empty line for linter

* Update types/php-serialize/index.d.ts

Co-Authored-By: Dmitry Demensky <10235949+demensky@users.noreply.github.com>

* Update types/php-serialize/index.d.ts

Co-Authored-By: Dmitry Demensky <10235949+demensky@users.noreply.github.com>

* Update types/php-serialize/index.d.ts

Co-Authored-By: Dmitry Demensky <10235949+demensky@users.noreply.github.com>

* Update index.d.ts

* Update tsconfig.json

* Revert tsconfig.json chnages

* Add reference types header for node

Co-authored-by: Dmitry Demensky <10235949+demensky@users.noreply.github.com>
2019-12-26 14:32:52 -06:00

26 lines
834 B
TypeScript

// Type definitions for php-serialize 3.0
// Project: https://github.com/steelbrain/php-serialize
// Definitions by: Changhui Lee <https://github.com/blurfx>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.7
/// <reference types="node" />
export interface SerializeOptions {
/** @default 'utf8' */
readonly encoding?: 'utf8' | 'binary';
}
export interface UnserializeOptions {
/** @default true' */
readonly strict?: boolean;
/** @default 'utf8' */
readonly encoding?: 'utf8' | 'binary';
}
export function isSerialized(givenItem: any, strict?: boolean): boolean;
export function serialize(item: any, scope?: any, givenOptions?: SerializeOptions): string;
export function unserialize(item: string | Buffer, scope?: any, givenOptions?: UnserializeOptions): any;