@lou.codes/constants
Version:
🔢 Shared constants and aliases to static methods, values and symbols.
80 lines (79 loc) • 1.69 kB
TypeScript
export declare const assign: {
<T extends {}, U>(target: T, source: U): T & U;
<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
<T extends {}, U, V, W>(
target: T,
source1: U,
source2: V,
source3: W,
): T & U & V & W;
(target: object, ...sources: any[]): any;
},
defineProperty: <T>(
o: T,
p: PropertyKey,
attributes: PropertyDescriptor & ThisType<any>,
) => T,
entries: {
<T>(
o:
| {
[s: string]: T;
}
| ArrayLike<T>,
): [string, T][];
(o: {}): [string, any][];
},
freeze: {
<T extends Function>(f: T): T;
<
T extends {
[idx: string]: U | null | undefined | object;
},
U extends string | bigint | number | boolean | symbol,
>(
o: T,
): Readonly<T>;
<T>(o: T): Readonly<T>;
},
fromEntries: {
<T = any>(
entries: Iterable<readonly [PropertyKey, T]>,
): {
[k: string]: T;
};
(entries: Iterable<readonly any[]>): any;
},
getOwnPropertyDescriptor: (
o: any,
p: PropertyKey,
) => PropertyDescriptor | undefined,
getPrototypeOf: (o: any) => any,
hasOwn: (o: object, v: PropertyKey) => boolean,
is: (value1: any, value2: any) => boolean,
keys: {
(o: object): string[];
(o: {}): string[];
},
values: {
<T>(
o:
| {
[s: string]: T;
}
| ArrayLike<T>,
): T[];
(o: {}): any[];
};
/**
* Alias for `Object.create(null)` combined with `Object.assign` to create an
* object without prototype.
*
* @see [Object.assign](https://mdn.io/Object.assign)
* @see [Object.create](https://mdn.io/Object.create)
*
* @returns Object with no prototype.
*/
export declare const create: <OutputType = {}>(
object?: OutputType,
) => OutputType;