Repository URL to install this package:
Version:
0.9.6 ▾
|
import { Primitive } from 'chain-able-boost'
export type Fn = Function
// obj with any properties
export interface PlainObj extends Object {
(any): any
call?: Fn
}
export type ArrayOfAny = Array<any>
export type Obj = Object | Function | PlainObj
export type ValidCollectionKey = Obj | Primitive
export type ValidMap = Map<ValidCollectionKey, ValidCollectionKey>
export type ValidSet = Set<ValidCollectionKey>
export type ValidCollection = ValidMap | ValidSet
export interface MatchableObj {
test(arg?: any): condition
}
export type Matchable =
| RegExp
| Fn
| string
| Array<RegExp | Fn | string>
| MatchableObj
export type Concatable = ArrayOfAny | ValidSet | ValidSet
export type MergeableArray = ArrayOfAny | ValidSet
// only when using toArr on map & set, unti l updated
export type Traversable = Obj | ValidMap | ValidSet
export type SchemaType = string | Obj | undefined | null
export type truthy = true | string | number | Obj | Symbol | ValidCollection
export type falsy = false | 0 | null | undefined
export type condition = truthy | falsy
export type ArrOrObj = ArrayOfAny | Obj
export type Arr =
| ArrayOfAny
| Concatable
| string
| null
| undefined
| boolean
| number
| Obj
export type Arguments = any | ArrayOfAny
export type strings = string | Array<string>
export interface FnHasSingleArg extends Function {
(arg: any): any
}
export interface FnArgIsObj extends FnHasSingleArg {
(arg: PlainObj): Primitive
}
export interface FnArgIsPrimitive extends FnHasSingleArg {
(arg: Primitive): Primitive
}
export interface ObjectDefine {
configurable: boolean
enumerable: boolean
writable: boolean
value: any
get: Function
set: Function
}
export declare interface SerializableObj {
(x: Primitive): Primitive
}
/**
* @see https://basarat.gitbooks.io/typescript/docs/types/readonly.html
*/
export declare interface FrozenObj extends Readonly<Object> {
readonly(x: Primitive): Primitive
}
export declare type Serializable = SerializableObj | Primitive | FrozenObj
export type ObjOrBoolean = Serializable | boolean
export type EMPTY_OBJ = FrozenObj
/**
* @see https://stackoverflow.com/a/39393254
*/
export type Class = { new(...args: any[]): any }
export { PlainObj as ObjWithKeys }
/**
* Global Event Handler Interface
*/
export interface EventHandlerArg<Props = any, State = any, Item = any> {
props?: Props
state?: State
item?: Item
event?: Event
}