atma-utils
Advanced tools
Comparing version
{ | ||
"name": "atma-utils", | ||
"description": "Helpers", | ||
"version": "0.1.12", | ||
"version": "0.1.13", | ||
"author": "Alexander Kit <alex.kit@atmajs.com>", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -1,5 +0,87 @@ | ||
/// <reference path="./ns/all.d.ts" /> | ||
declare module "atma-utils" { | ||
export = Lib; | ||
} | ||
declare namespace Lib { | ||
export function is_Function(mix: any): boolean | ||
export function is_Array(mix: any): boolean | ||
export function is_ArrayLike(mix: any): boolean | ||
export function is_String(mix: any): boolean | ||
export function is_Object(mix: any): boolean | ||
export function is_notEmptyString(mix: any): boolean | ||
export function is_rawObject(mix: any): boolean | ||
export function is_Date(mix: any): boolean | ||
export function is_NODE(mix: any): boolean | ||
export function is_DOM(mix: any): boolean | ||
export function obj_getProperty<T>(obj: any, prop: string): T | ||
export function obj_setProperty<T>(obj: any, prop: string, val: T): void | ||
export function obj_hasProperty(obj: any, prop: string): boolean | ||
export function obj_extend<T1, T2>(a: T1, b: T2): T1 & T2 | ||
export function obj_extendDefaults<T1, T2>(a: T1, b: T2): T1 & T2 | ||
export function obj_extendMany<T1, T2, T3, T4, T5, T6>(a: T1, b: T2, c?: T3, d?: T4, e?: T5, f?: T6): T1 & T2 & T3 & T4 & T5 & T6 | ||
export function obj_extendProperties<T1, T2>(a: T1, b: T2): T1 & T2 | ||
export function obj_extendPropertiesDefaults<T1, T2>(a: T1, b: T2): T1 & T2 | ||
export function obj_create<T1>(a: T1): T1 | ||
export function obj_defineProperty(o: any, p: string, attributes: PropertyDescriptor & ThisType<any>): void; | ||
export class class_EventEmitter { | ||
on: (event: string, cb: Function) => this | ||
once: (event: string, cb: Function) => this | ||
off: (event: string, cb?: Function) => this | ||
emit: (event: string, ...args: any[]) => this | ||
trigger: (event: string, ...args: any[]) => this | ||
pipe: (eventName: string) => (...args) => void | ||
} | ||
export function class_create<T1, T2, T3>(p1: T1, p2?: T2, p3?: T3): new (...args: any[]) => T3 & T2 & T1; | ||
type DeferredLike = class_Dfr | PromiseLike<any>; | ||
export class class_Dfr { | ||
then(onOk: (...args: any[]) => void | DeferredLike, onFail?: (...args: any[]) => void | DeferredLike) | ||
done (done: (...args: any[]) => void | DeferredLike): this | ||
fail (fail: (error: any | Error) => void): this | ||
reject(error: any | Error) : this | ||
resolve(...args: any[]): this | ||
always (always: Function): this | ||
defer (): this | ||
isResolved (): boolean | ||
isRejected (): boolean | ||
isBusy (): boolean | ||
resolveDelegate (): (result: any) => void | any | ||
rejectDelegate (): (result: Error | any) => void | any | ||
static run (fn: (resolve: Function, reject?: Function) => void | class_Dfr, ctx?: any): DeferredLike | ||
static resolve (...args: any[]): DeferredLike | ||
static reject (...args: any[]): DeferredLike | ||
} | ||
export class class_Uri { | ||
constructor (path) | ||
protocol: string | ||
value: string | ||
path: string | ||
file: string | ||
extension: string | ||
cdUp (): this | ||
combine (path: string): class_Uri | ||
toString (): string | ||
toLocalFile (): string | ||
toLocalDir (): string | ||
toPathAndQuery (): string | ||
/** | ||
* @return Current Uri Path{String} that is relative to @arg1 Uri | ||
*/ | ||
toRelativeString (uri: class_Uri): string | ||
isRelative (): boolean | ||
getName (): string | ||
static combine (...paths: string[]): string | ||
} | ||
} |
@@ -1,31 +0,81 @@ | ||
/// <reference path="./ns/all.d.ts" /> | ||
export function is_Function(mix: any): boolean | ||
export function is_Array(mix: any): boolean | ||
export function is_ArrayLike(mix: any): boolean | ||
export function is_String(mix: any): boolean | ||
export function is_Object(mix: any): boolean | ||
export function is_notEmptyString(mix: any): boolean | ||
export function is_rawObject(mix: any): boolean | ||
export function is_Date(mix: any): boolean | ||
export function is_NODE(mix: any): boolean | ||
export function is_DOM(mix: any): boolean | ||
export default Lib; | ||
export function obj_getProperty<T>(obj: any, prop: string): T | ||
export function obj_setProperty<T>(obj: any, prop: string, val: T): void | ||
export function obj_hasProperty(obj: any, prop: string): boolean | ||
export function obj_extend<T1, T2>(a: T1, b: T2): T1 & T2 | ||
export function obj_extendDefaults<T1, T2>(a: T1, b: T2): T1 & T2 | ||
export function obj_extendMany<T1, T2, T3, T4, T5, T6>(a: T1, b: T2, c?: T3, d?: T4, e?: T5, f?: T6): T1 & T2 & T3 & T4 & T5 & T6 | ||
export function obj_extendProperties<T1, T2>(a: T1, b: T2): T1 & T2 | ||
export function obj_extendPropertiesDefaults<T1, T2>(a: T1, b: T2): T1 & T2 | ||
export function obj_create<T1>(a: T1): T1 | ||
export function obj_defineProperty(o: any, p: string, attributes: PropertyDescriptor & ThisType<any>): void; | ||
export const is_Function: typeof Is.is_Function; | ||
export const is_Array: typeof Is.is_Array | ||
export const is_ArrayLike: typeof Is.is_ArrayLike | ||
export const is_String: typeof Is.is_String | ||
export const is_Object: typeof Is.is_Object | ||
export const is_notEmptyString: typeof Is.is_notEmptyString | ||
export const is_rawObject: typeof Is.is_rawObject | ||
export const is_Date: typeof Is.is_Date | ||
export const is_NODE: typeof Is.is_NODE | ||
export const is_DOM: typeof Is.is_DOM | ||
export class class_EventEmitter { | ||
on: (event: string, cb: Function) => this | ||
once: (event: string, cb: Function) => this | ||
off: (event: string, cb?: Function) => this | ||
emit: (event: string, ...args: any[]) => this | ||
trigger: (event: string, ...args: any[]) => this | ||
pipe: (eventName: string) => (...args) => void | ||
} | ||
export const obj_getProperty: typeof Obj.obj_getProperty; | ||
export const obj_setProperty: typeof Obj.obj_setProperty; | ||
export const obj_hasProperty: typeof Obj.obj_hasProperty; | ||
export const obj_extend: typeof Obj.obj_extend; | ||
export const obj_extendDefaults: typeof Obj.obj_extendDefaults; | ||
export const obj_extendMany: typeof Obj.obj_extendMany; | ||
export const obj_extendProperties: typeof Obj.obj_extendProperties; | ||
export const obj_extendPropertiesDefaults: typeof Obj.obj_extendPropertiesDefaults; | ||
export const obj_create: typeof Obj.obj_create; | ||
export const obj_defineProperty: typeof Obj.obj_defineProperty; | ||
export function class_create<T1, T2, T3>(p1: T1, p2?: T2, p3?: T3): new (...args: any[]) => T3 & T2 & T1; | ||
export const class_create: typeof ClassBase.class_create; | ||
export const class_Dfr: typeof ClassBase.class_Dfr; | ||
export const class_EventEmitter: typeof ClassBase.class_EventEmitter; | ||
export const class_Uri: typeof ClassBase.class_Uri; | ||
type DeferredLike = class_Dfr | PromiseLike<any>; | ||
export class class_Dfr { | ||
then(onOk: (...args: any[]) => void | DeferredLike, onFail?: (...args: any[]) => void | DeferredLike) | ||
done (done: (...args: any[]) => void | DeferredLike): this | ||
fail (fail: (error: any | Error) => void): this | ||
reject(error: any | Error) : this | ||
resolve(...args: any[]): this | ||
always (always: Function): this | ||
defer (): this | ||
isResolved (): boolean | ||
isRejected (): boolean | ||
isBusy (): boolean | ||
resolveDelegate (): (result: any) => void | any | ||
rejectDelegate (): (result: Error | any) => void | any | ||
static run (fn: (resolve: Function, reject?: Function) => void | class_Dfr, ctx?: any): DeferredLike | ||
static resolve (...args: any[]): DeferredLike | ||
static reject (...args: any[]): DeferredLike | ||
} | ||
export class class_Uri { | ||
constructor (path) | ||
protocol: string | ||
value: string | ||
path: string | ||
file: string | ||
extension: string | ||
cdUp (): this | ||
combine (path: string): class_Uri | ||
toString (): string | ||
toLocalFile (): string | ||
toLocalDir (): string | ||
toPathAndQuery (): string | ||
/** | ||
* @return Current Uri Path{String} that is relative to @arg1 Uri | ||
*/ | ||
toRelativeString (uri: class_Uri): string | ||
isRelative (): boolean | ||
getName (): string | ||
static combine (...paths: string[]): string | ||
} |
70315
1.46%2554
0.75%8
-46.67%