@types/type-check

TypeScript definitions for type-check

  • Types
  • ESM
  • CJS
License
MIT
Deps
0
Install Size
4 kB
Vulns
0
Published

Get started

$npm install @types/type-check
$pnpm add @types/type-check
$yarn add @types/type-check
$bun add @types/type-check
$deno add npm:@types/type-check
$vlt install @types/type-check
$vp add @types/type-check
# Usually installed as a dev dependency
$npm install -D @types/type-check
$pnpm add -D @types/type-check
$yarn add -D @types/type-check
$bun add -d @types/type-check
$deno add -D npm:@types/type-check
$vlt install -D @types/type-check
$vp add -D @types/type-check

Weekly DownloadsAcross all versions

Versions

View all versions
0.3.31
latestts4.8ts4.9ts5.0ts5.1ts5.2ts5.3ts5.4ts5.5ts5.6ts5.7ts5.8ts5.9ts6.0
0.3.30
ts4.5ts4.6ts4.7
0.3.28
ts4.3ts4.4
0.3.27
ts2.0ts2.1ts2.2ts2.3ts2.4ts2.5ts2.6ts2.7ts2.8ts2.9ts3.0ts3.1ts3.2ts3.3ts3.4ts3.5ts3.6ts3.7ts3.8ts3.9ts4.0ts4.1ts4.2

Readme

Installation

npm install --save @types/type-check

Summary

This package contains type definitions for type-check (https://github.com/gkz/type-check).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/type-check.

index.d.ts

export const VERSION: string;

export interface CustomType {
    typeOf: string;
    validate: (input: unknown) => boolean;
}

export interface CustomTypes {
    [typeName: string]: CustomType;
}

export interface Options {
    customTypes?: CustomTypes;
}

export function typeCheck(type: string, input: unknown, options?: Options): boolean;

// This is, in fact, a single element tuple.
// eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
export type ParsedType = [ParsedTypeData];

export interface ParsedTypeData {
    type: string;
}

export function parseType(type: string): ParsedType;

export function parsedTypeCheck(parsedType: ParsedType, input: string, options?: Options): boolean;
Additional Details
  • Last updated: Fri, 06 Sep 2024 21:07:35 GMT
  • Dependencies: none

Credits

These definitions were written by Hans Windhoff.