mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-17 22:44:18 +08:00
* [adone] refactoring, new typings * refactor to namespace style * move adone.run to adone.application * [std] remove unnecessary std.ts code * move is and x to separate dirs * init collections, add LinkedList typings, move ExBuffer here * init event, move EventEmitter and AsyncEmitter here * init fs * init fast * init streams, add core typings * remove common * [util] add userdir, LogRotator, debounce, uuid.v3, fix entries * [shani] add spy.waitFor* definitions * [is] add descriptions * [promise] callbackify * [adone] rename is.exbuffer to is.byteArray * [adone] add data typings * [adone] rename is.exdate to is.datetime * [adone] fs fixes * [adone] add datetime typings * [adone] improve datetime help messages * [adone] math * decomposition * add descriptions for Long * add typings for matrix, simd, BitSet, BigNumber, random * collections, math * add some lazify options * [collections] add help messages for ByteArray * [collections] add typings for Queue, AsyncQueue, PriorityQueue, FastLRU, Stack, BinarySearchTree, AVLTree, RedBlackTree, ArraySet, BufferList, DefaultMap, LRU, TimedoutMap * [math] add missing BitSet methods, normalize help messages * [adone] compressors, fast * [fast] change FIle.is* methods * [compressors] init * [adone] archives, fs, datetime * [archives] init, tar, zip * [fs] add AbstractRandomAccessReader, RandomAccessFdReader, RandomAccessBufferReader * [datetime] add support for ms-dos format * is, streams, fast * [fast] fix typo * [is] fix fast stream predicates, add some runtime predicates * [streams] more detailed core help messages
134 lines
4.5 KiB
TypeScript
134 lines
4.5 KiB
TypeScript
/// <reference types="node" />
|
|
|
|
declare namespace adone {
|
|
const _null: symbol;
|
|
export { _null as null };
|
|
export function noop(): void;
|
|
export function identity<T>(x: T): T;
|
|
export function truly(): true;
|
|
export function falsely(): false;
|
|
export const ok: "OK";
|
|
export const bad: "BAD";
|
|
export const exts: [".js", ".tjs", ".ajs"];
|
|
export function log(...args: any[]): void;
|
|
export function fatal(...args: any[]): void;
|
|
export function error(...args: any[]): void;
|
|
export function warn(...args: any[]): void;
|
|
export function info(...args: any[]): void;
|
|
export function debug(...args: any[]): void;
|
|
export function trace(...args: any[]): void;
|
|
export function o(...props: any[]): object;
|
|
export const Date: typeof global.Date;
|
|
export const hrtime: typeof global.process.hrtime;
|
|
export const setTimeout: typeof global.setTimeout;
|
|
export const setInterval: typeof global.setInterval;
|
|
export const setImmediate: typeof global.setImmediate;
|
|
export const clearTimeout: typeof global.clearTimeout;
|
|
export const clearInterval: typeof global.clearInterval;
|
|
export const clearImmediate: typeof global.clearImmediate;
|
|
|
|
namespace I {
|
|
interface LazifyOptions {
|
|
/**
|
|
* Whether the new properties are configurable, false by default
|
|
*/
|
|
configurable?: boolean;
|
|
|
|
/**
|
|
* Whether the new properties are writable, false by default
|
|
*/
|
|
writable?: boolean;
|
|
|
|
/**
|
|
* A custom mapper for values, by default returns the exported object (module.exports),
|
|
* but if the object is a transpiled es module and the default export is defined,
|
|
* it returns the default export
|
|
*
|
|
* @param key property
|
|
* @param mod module.exports
|
|
*/
|
|
mapper?(key: string, mod: any): any;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Extends the given object(or creates a new one) with the given lazyfied properties
|
|
*/
|
|
export function lazify(modules: object, obj?: object, require?: (path: string) => any, options?: I.LazifyOptions): object;
|
|
|
|
/**
|
|
* Defines or extends the private part of the given object with the given lazyfied properties
|
|
*/
|
|
export function lazifyPrivate(modules: object, obj?: object, require?: (path: string) => any, options?: I.LazifyOptions): object;
|
|
|
|
/**
|
|
* Defines the private part of the given object with the given modules
|
|
*/
|
|
export function definePrivate(modules: object, obj: object): object;
|
|
|
|
/**
|
|
* Returns the private part of the given object
|
|
*/
|
|
export function private(obj: object): any;
|
|
|
|
namespace I {
|
|
interface Tag {
|
|
set(Class: object, tag: string): void;
|
|
has(obj: object, tag: string): boolean;
|
|
define(tag: string, predicate?: string): void;
|
|
SUBSYSTEM: symbol;
|
|
APPLICATION: symbol;
|
|
TRANSFORM: symbol;
|
|
CORE_STREAM: symbol;
|
|
LOGGER: symbol;
|
|
LONG: symbol;
|
|
BIGNUMBER: symbol;
|
|
EXBUFFER: symbol;
|
|
EXDATE: symbol;
|
|
CONFIGURATION: symbol;
|
|
GENESIS_NETRON: symbol;
|
|
GENESIS_PEER: symbol;
|
|
NETRON: symbol;
|
|
NETRON_PEER: symbol;
|
|
NETRON_ADAPTER: symbol;
|
|
NETRON_DEFINITION: symbol;
|
|
NETRON_DEFINITIONS: symbol;
|
|
NETRON_REFERENCE: symbol;
|
|
NETRON_INTERFACE: symbol;
|
|
NETRON_STUB: symbol;
|
|
NETRON_REMOTESTUB: symbol;
|
|
NETRON_STREAM: symbol;
|
|
FAST_STREAM: symbol;
|
|
FAST_FS_STREAM: symbol;
|
|
FAST_FS_MAP_STREAM: symbol;
|
|
}
|
|
}
|
|
export const tag: I.Tag;
|
|
export function bind(libName: string): object;
|
|
export function getAssetAbsolutePath(relPath: string): string;
|
|
export function loadAsset(relPath: string): string | Buffer;
|
|
export function require(path: string): object;
|
|
export const package: object;
|
|
|
|
namespace I {
|
|
interface Runtime {
|
|
term: object; // TODO
|
|
logger: object; // TODO
|
|
app: object; // TODO
|
|
}
|
|
}
|
|
|
|
export const runtime: I.Runtime;
|
|
|
|
export const homePath: string;
|
|
export const rootPath: string;
|
|
export const etcPath: string;
|
|
export const config: object;
|
|
export const emptyBuffer: Buffer;
|
|
|
|
export const assert: assertion.I.AssertFunction;
|
|
export const expect: assertion.I.ExpectFunction;
|
|
|
|
export const std: typeof nodestd;
|
|
}
|