summaryrefslogtreecommitdiff
path: root/std/types/prop-types
diff options
context:
space:
mode:
authorSteven Guerrero <42647963+Soremwar@users.noreply.github.com>2020-04-16 00:27:10 -0500
committerGitHub <noreply@github.com>2020-04-16 01:27:10 -0400
commit6441852a1d5eef0d05ed172a00bef58ad5988842 (patch)
tree8734b6d79a2c203ac6f915cbc720f5c3f2484d9c /std/types/prop-types
parentaab26d226e32ac84da8c855388217b3ee781979d (diff)
Migrate std/types to x/types (#4771)
Diffstat (limited to 'std/types/prop-types')
-rw-r--r--std/types/prop-types/README.md15
-rw-r--r--std/types/prop-types/v15.7.2/prop-types.d.ts122
2 files changed, 0 insertions, 137 deletions
diff --git a/std/types/prop-types/README.md b/std/types/prop-types/README.md
deleted file mode 100644
index cd2c055d5..000000000
--- a/std/types/prop-types/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-Types for Facebook's Prop-Types library.
-
-[![npm version](https://img.shields.io/npm/v/prop-types.svg?style=flat)](https://www.npmjs.com/package/prop-types)
-
-You can use prop-types to document the intended types of properties passed to
-functions and classes. This library is intended for his use alongside Facebook's
-React library, but can be used freely for runtime type checking outside of the
-React environment.
-
-### Usage Examples
-
-```typescript
-// @deno-types="https://deno.land/std/types/prop-types/v15.7.2/prop-types.d.ts"
-import PropTypes from "https://cdn.pika.dev/prop-types@15.7.2";
-```
diff --git a/std/types/prop-types/v15.7.2/prop-types.d.ts b/std/types/prop-types/v15.7.2/prop-types.d.ts
deleted file mode 100644
index 7367d4841..000000000
--- a/std/types/prop-types/v15.7.2/prop-types.d.ts
+++ /dev/null
@@ -1,122 +0,0 @@
-// These types are adapted from
-// https://github.com/DefinitelyTyped/DefinitelyTyped to work under Deno.
-//
-// Project: https://github.com/reactjs/prop-types, https://facebook.github.io/react
-// Definitions by: DovydasNavickas <https://github.com/DovydasNavickas>
-// Ferdy Budhidharma <https://github.com/ferdaber>
-// Sebastian Silbermann <https://github.com/eps1lon>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-// TypeScript Version: 2.8
-
-/* eslint-disable */
-export type ReactComponentLike =
- | string
- | ((props: any, context?: any) => any)
- | (new (props: any, context?: any) => any);
-
-export interface ReactElementLike {
- type: ReactComponentLike;
- props: any;
- key: string | number | null;
-}
-
-export interface ReactNodeArray extends Array<ReactNodeLike> {}
-
-export type ReactNodeLike =
- | {}
- | ReactElementLike
- | ReactNodeArray
- | string
- | number
- | boolean
- | null
- | undefined;
-
-export const nominalTypeHack: unique symbol;
-
-export type IsOptional<T> = undefined extends T ? true : false;
-
-export type RequiredKeys<V> = {
- [K in keyof V]-?: Exclude<V[K], undefined> extends Validator<infer T>
- ? IsOptional<T> extends true
- ? never
- : K
- : never;
-}[keyof V];
-export type OptionalKeys<V> = Exclude<keyof V, RequiredKeys<V>>;
-export type InferPropsInner<V> = { [K in keyof V]-?: InferType<V[K]> };
-
-export interface Validator<T> {
- (
- props: { [key: string]: any },
- propName: string,
- componentName: string,
- location: string,
- propFullName: string
- ): Error | null;
- [nominalTypeHack]?: {
- type: T;
- };
-}
-
-export interface Requireable<T> extends Validator<T | undefined | null> {
- isRequired: Validator<NonNullable<T>>;
-}
-
-export type ValidationMap<T> = { [K in keyof T]?: Validator<T[K]> };
-
-export type InferType<V> = V extends Validator<infer T> ? T : any;
-export type InferProps<V> = InferPropsInner<Pick<V, RequiredKeys<V>>> &
- Partial<InferPropsInner<Pick<V, OptionalKeys<V>>>>;
-
-export const any: Requireable<any>;
-export const array: Requireable<any[]>;
-export const bool: Requireable<boolean>;
-export const func: Requireable<(...args: any[]) => any>;
-export const number: Requireable<number>;
-export const object: Requireable<object>;
-export const string: Requireable<string>;
-export const node: Requireable<ReactNodeLike>;
-export const element: Requireable<ReactElementLike>;
-export const symbol: Requireable<symbol>;
-export const elementType: Requireable<ReactComponentLike>;
-export function instanceOf<T>(
- expectedClass: new (...args: any[]) => T
-): Requireable<T>;
-export function oneOf<T>(types: ReadonlyArray<T>): Requireable<T>;
-export function oneOfType<T extends Validator<any>>(
- types: T[]
-): Requireable<NonNullable<InferType<T>>>;
-export function arrayOf<T>(type: Validator<T>): Requireable<T[]>;
-export function objectOf<T>(
- type: Validator<T>
-): Requireable<{ [K in keyof any]: T }>;
-export function shape<P extends ValidationMap<any>>(
- type: P
-): Requireable<InferProps<P>>;
-export function exact<P extends ValidationMap<any>>(
- type: P
-): Requireable<Required<InferProps<P>>>;
-
-/**
- * Assert that the values match with the type specs.
- * Error messages are memorized and will only be shown once.
- *
- * @param typeSpecs Map of name to a ReactPropType
- * @param values Runtime values that need to be type-checked
- * @param location e.g. "prop", "context", "child context"
- * @param componentName Name of the component for error messages
- * @param getStack Returns the component stack
- */
-export function checkPropTypes(
- typeSpecs: any,
- values: any,
- location: string,
- componentName: string,
- getStack?: () => any
-): void;
-
-/**
- * Only available if NODE_ENV=production
- */
-export function resetWarningCache(): void;