DefinitelyTyped/types/python-struct/index.d.ts
2019-08-12 13:20:34 -07:00

26 lines
766 B
TypeScript

// Type definitions for python-struct 1.0
// Project: https://github.com/danielgindi/node-python-struct
// Definitions by: Florian Keller <https://github.com/ffflorian>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import * as Long from 'long';
export type DataType = number | Long | string | boolean;
export function pack(format: string, data: DataType[]): Buffer;
export function pack(format: string, ...data: DataType[]): Buffer;
export function sizeOf(format: string): number;
export function unpack(
format: string,
data: Buffer,
checkBounds?: boolean,
): DataType[];
export function unpackFrom(
format: string,
data: Buffer,
checkBounds: boolean | undefined,
position: number,
): DataType;