
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
@ergodark/types
Advanced tools
This package contains various utility and helper types that can be imported by a TypeScript project.
This package only contains TypeScript types.
npm install @ergodark/types
You can use this library's types in your TypeScript projects like so:
import type { TypeNameHere } from '@ergodark/types'
const variable: TypeNameHere;
import type * as ErgoDark from '@ergodark/types'
const variable: ErgoDark.TypeNameHere;
This library provides the following types:
Represents all "primitive" types. Specifically: string, number, bigint,
boolean, symbol, null, and undefined.
import type { Primitive } from '@ergodark/types'
let primitive: Primitive = "yes";
primitive = 1;
primitive = Symbol('yes');
primitive = null;
primitive = new Date(); // <== TypeScript error
Represents all "falsy" types. Specifically: false, '', 0, null, and
undefined.
import type { Falsy } from '@ergodark/types'
let falsy: Falsy = "";
falsy = 0;
falsy = false;
falsy = null;
falsy = true; // <== TypeScript error
Represents all "nullish" types. Specifically: null and undefined.
import type { Nullish } from '@ergodark/types'
let nullish: Nullish = null;
nullish = undefined;
nullish = true; // <== TypeScript error
TypeScript's Partial utility type but applied recursively to every property and any sub-properties.
import type { DeepPartial } from '@ergodark/types'
type T = { a: string, b: { c: { d: number }}};
let t:T = { a: "enough!", b: { c: { d: 1 }}};
let t_bad:T = { a: "enough?" }; // <== TypeScript error
let t2:Partial<T> = { a: "enough?" };
let t2_bad:Partial<T> = { a: "enough?", b: {}}; // <== TypeScript error
let t3:DeepPartial<T> = { a: "enough?" };
let t3_ok:DeepPartial<T> = { a: "enough?", b: {}};
Represents any possible object key.
import type { AnyKey } from '@ergodark/types'
let key: AnyKey = "key";
key = Symbol('key');
key = true; // <== TypeScript error
Represents any possible function.
import type { AnyFunction } from '@ergodark/types'
let fn: AnyFunction = () => true;
fn = Symbol('key'); // <== TypeScript error
Represents any possible constructor.
import type { AnyConstructor } from '@ergodark/types'
let myConstructor: AnyConstructor = Date;
myConstructor = Symbol('key'); // <== TypeScript error
Represents any possible class.
import type { AnyClass } from '@ergodark/types'
let MyClass: AnyClass = class { bark() { return 'woof!' }};
MyClass = Symbol('key'); // <== TypeScript error
Represents any object with string keys. Alias of Record<string, unknown>.
import type { AnyRecord } from '@ergodark/types'
let record: AnyRecord = { a: 1 };
record = Symbol('key'); // <== TypeScript error
Recursively unwrap the return value of a resolved promise.
import type { Awaited } from '@ergodark/types'
const p1 = new Promise<boolean>(resolve => resolve(true));
const p2 = new Promise<typeof p1>(resolve => resolve(p1));
// Type of `p2` is Promise<Promise<boolean>> ...
let result: Awaited<typeof p2>; // <== However, type of `result` is boolean
Represents any valid (and a few invalid) HTTP status code.
import fetch from 'isomorphic-unfetch'
import type { HttpStatusCode } from '@ergodark/types'
const res = await fetch('https://google.com');
const status: HttpStatusCode = res.status;
Issues and pull requests are welcome! In lieu of a formal styleguide, take care to maintain the existing coding style.
Please test your code!
FAQs
Various utility and helper types for TypeScript projects
We found that @ergodark/types demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.