@kz/common-types@0.0.11Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
A collection of the most common types used across kz packages, adapted for API consistency and case-coverage, exhaustively tested, and documented thoroughly.
common-types
kz is a library providing heavily tested and documented features with consistent and predictable APIs designed to simplify the development and maintenance of complex, performant, and scalable Deno applications.
@kz/common-types
The @kz/common-types
module provides base type aliases, interfaces, and enums
for the core modules and others commonly used across kz libraries and in
general development.
import type { IHelpful, Scalar } from './mod.ts'; const help: IHelpful = { helpUrl: 'https://example.com', }; const pathId: Scalar = help.helpUrl;
Why are enums here?
Enums, as integereleven uses them, only have numeric values. Because of this, we can generally get away with using the enum only as a type and provide a matching number without referencing the enum itself.
We use the enums more as type documentation for developers.
import { assertEquals } from '@std/assert'; import type { ComparisonResult } from './mod.ts'; function compare(a: number, b: number): ComparisonResult { if (a === b) return 0; return a > b ? 1 : -1; } const result = compare(10, 9); // ComparisonResult.Greater assertEquals(result, 1);
Contributing
Contributions are welcome! Take a look at our contributing guidelines to get started.
License
The MIT License (MIT) 2022 integereleven. Refer to LICENSE for details.
Built with ❤ by integereleven
Add Package
deno add jsr:@kz/common-types
Import symbol
import * as common_types from "@kz/common-types";
Import directly with a jsr specifier
import * as common_types from "jsr:@kz/common-types";
Add Package
pnpm i jsr:@kz/common-types
pnpm dlx jsr add @kz/common-types
Import symbol
import * as common_types from "@kz/common-types";
Add Package
yarn add jsr:@kz/common-types
yarn dlx jsr add @kz/common-types
Import symbol
import * as common_types from "@kz/common-types";
Add Package
npx jsr add @kz/common-types
Import symbol
import * as common_types from "@kz/common-types";
Add Package
bunx jsr add @kz/common-types
Import symbol
import * as common_types from "@kz/common-types";