From 6441852a1d5eef0d05ed172a00bef58ad5988842 Mon Sep 17 00:00:00 2001 From: Steven Guerrero <42647963+Soremwar@users.noreply.github.com> Date: Thu, 16 Apr 2020 00:27:10 -0500 Subject: Migrate std/types to x/types (#4771) --- std/types/prop-types/README.md | 15 ---- std/types/prop-types/v15.7.2/prop-types.d.ts | 122 --------------------------- 2 files changed, 137 deletions(-) delete mode 100644 std/types/prop-types/README.md delete mode 100644 std/types/prop-types/v15.7.2/prop-types.d.ts (limited to 'std/types/prop-types') 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 -// Ferdy Budhidharma -// Sebastian Silbermann -// 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 {} - -export type ReactNodeLike = - | {} - | ReactElementLike - | ReactNodeArray - | string - | number - | boolean - | null - | undefined; - -export const nominalTypeHack: unique symbol; - -export type IsOptional = undefined extends T ? true : false; - -export type RequiredKeys = { - [K in keyof V]-?: Exclude extends Validator - ? IsOptional extends true - ? never - : K - : never; -}[keyof V]; -export type OptionalKeys = Exclude>; -export type InferPropsInner = { [K in keyof V]-?: InferType }; - -export interface Validator { - ( - props: { [key: string]: any }, - propName: string, - componentName: string, - location: string, - propFullName: string - ): Error | null; - [nominalTypeHack]?: { - type: T; - }; -} - -export interface Requireable extends Validator { - isRequired: Validator>; -} - -export type ValidationMap = { [K in keyof T]?: Validator }; - -export type InferType = V extends Validator ? T : any; -export type InferProps = InferPropsInner>> & - Partial>>>; - -export const any: Requireable; -export const array: Requireable; -export const bool: Requireable; -export const func: Requireable<(...args: any[]) => any>; -export const number: Requireable; -export const object: Requireable; -export const string: Requireable; -export const node: Requireable; -export const element: Requireable; -export const symbol: Requireable; -export const elementType: Requireable; -export function instanceOf( - expectedClass: new (...args: any[]) => T -): Requireable; -export function oneOf(types: ReadonlyArray): Requireable; -export function oneOfType>( - types: T[] -): Requireable>>; -export function arrayOf(type: Validator): Requireable; -export function objectOf( - type: Validator -): Requireable<{ [K in keyof any]: T }>; -export function shape

>( - type: P -): Requireable>; -export function exact

>( - type: P -): Requireable>>; - -/** - * 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; -- cgit v1.2.3