Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions types/aphrodite/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ type FontFamily =
| BaseCSSProperties['fontFamily']
| CSS.FontFace;

// Replace with Exclude once on 2.8+
type Diff<T extends string, U extends string> = (
& { [P in T]: P }
& { [P in U]: never }
& { [x: string]: never }
)[T];
type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;

type CSSProperties = Omit<BaseCSSProperties, 'fontFamily'> & {
fontFamily?: FontFamily | FontFamily[];
Expand Down
3 changes: 1 addition & 2 deletions types/dispatchr/addons/createStore.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { StoreClass, Store } from '../index';

type Diff<T extends string, U extends string> = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T];
type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;

interface StoreOptions {
storeName: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ interface TestEntity {
name?: string;
location?: string;
symbol?: string;

[keySymbol: string]: any;
[Datastore.KEY]?: any;
}

const kind = 'Company';
Expand Down
10 changes: 6 additions & 4 deletions types/google-cloud__datastore/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Project: https://github.com/googleapis/nodejs-datastore
// Definitions by: Antoine Beauvais-Lacasse <https://github.com/beaulac>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
// TypeScript Version: 2.7

/// <reference types="node" />

Expand Down Expand Up @@ -36,7 +36,7 @@ declare module '@google-cloud/datastore' {
class Datastore extends DatastoreRequest_ {
constructor(options: InitOptions);

readonly KEY: KEY_SYMBOL;
readonly KEY: typeof Datastore.KEY;
readonly MORE_RESULTS_AFTER_CURSOR: MoreResultsAfterCursor;
readonly MORE_RESULTS_AFTER_LIMIT: MoreResultsAfterLimit;
readonly NO_MORE_RESULTS: NoMoreResults;
Expand Down Expand Up @@ -81,7 +81,7 @@ declare module '@google-cloud/datastore' {
}

namespace Datastore {
const KEY: KEY_SYMBOL;
const KEY: unique symbol;
const MORE_RESULTS_AFTER_CURSOR: MoreResultsAfterCursor;
const MORE_RESULTS_AFTER_LIMIT: MoreResultsAfterLimit;
const NO_MORE_RESULTS: NoMoreResults;
Expand All @@ -93,6 +93,8 @@ declare module '@google-cloud/datastore' {
}

declare module '@google-cloud/datastore/entity' {
import Datastore = require("@google-cloud/datastore");

interface DatastoreInt {
value: string;
}
Expand Down Expand Up @@ -133,7 +135,7 @@ declare module '@google-cloud/datastore/entity' {
parent?: DatastoreKey;
}

type KEY_SYMBOL = symbol;
type KEY_SYMBOL = typeof Datastore.KEY;

interface DatastorePayload<T> {
key: DatastoreKey;
Expand Down
5 changes: 1 addition & 4 deletions types/grid-styled/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6

export type Diff<T extends string, U extends string> = ({ [P in T]: P } &
{ [P in U]: never } & { [x: string]: never })[T];

export type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
export type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;

import { ComponentClass } from "react";
import { StyledComponentClass } from "styled-components";
Expand Down
3 changes: 1 addition & 2 deletions types/mirrorx/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import * as React from 'react';
import { Connect } from 'react-redux';
import { match } from "react-router";

export type Diff<T extends string, U extends string> = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T];
export type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
export type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;

export interface model {
name: string;
Expand Down
6 changes: 1 addition & 5 deletions types/react-autosuggest/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ declare namespace Autosuggest {
*/

/** @internal */
type Diff<T extends string, U extends string> = ({ [P in T]: P } &
{ [P in U]: never } & { [x: string]: never })[T];

/** @internal */
type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;

interface SuggestionsFetchRequestedParams {
value: string;
Expand Down
2 changes: 1 addition & 1 deletion types/react-bootstrap-table/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ export interface Options<TRow extends object = any> {
* The function allows you to make further modifications to the cell value prior to it being saved. You need to
* return the final cell value to use.
*/
onCellEdit?<K extends keyof TRow>(row: TRow, fieldName: K, value: TRow[K]): TRow[K];
onCellEdit?<K extends string & keyof TRow>(row: TRow, fieldName: K, value: TRow[K]): TRow[K];
/**
* Custom message to show when the InsertModal save fails validation.
* Default message is 'Form validate errors, please checking!'
Expand Down
3 changes: 1 addition & 2 deletions types/react-bootstrap/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

import * as React from 'react';

export type Diff<T extends string, U extends string> = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T];
export type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
export type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;

export type Sizes = 'xs' | 'xsmall' | 'sm' | 'small' | 'medium' | 'lg' | 'large';

Expand Down
6 changes: 1 addition & 5 deletions types/react-dynamic-number/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@

import * as React from 'react';

/**
* remove Diff & Omit when in will be placed in TS from scratch
*/
export type Diff<T extends string, U extends string> = ({[P in T]: P} & {[P in U]: never} & {[x: string]: never})[T];
export type Omit<T, K extends keyof T> = {[P in Diff<keyof T, K>]: T[P]};
export type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;

export type BaseInputProps = Partial<
Omit<
Expand Down
7 changes: 1 addition & 6 deletions types/react-geosuggest/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ export default class Geosuggest extends Component<GeosuggestProps> {
}

// Replace with Exclude once on 2.8+
export type Diff<T extends string, U extends string> = (
& { [P in T]: P }
& { [P in U]: never }
& { [x: string]: never }
)[T];
export type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
export type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;

export interface GeosuggestProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'style'> {
placeholder?: string;
Expand Down
7 changes: 3 additions & 4 deletions types/react-i18next/src/translate.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ export interface TranslateHocProps {
}

// Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766
type Diff<T extends string, U extends string> = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T];
type Omit<T, K extends string> = Pick<T, Diff<keyof T, K>>;
type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;

type InjectedProps = InjectedI18nProps & InjectedTranslateProps;

Expand All @@ -32,11 +31,11 @@ export interface WrapperComponentClass<P = {}, PWrapped = {}> extends React.Comp
// Injects props and removes them from the prop requirements.
// Adds the new properties t (or whatever the translation function is called) and i18n if needed.
export type InferableComponentEnhancerWithProps<TTranslateFunctionName extends string> =
<P extends {}>(component: React.ComponentClass<P> | React.StatelessComponent<P>) =>
<P extends { [key: string]: any }>(component: React.ComponentClass<P> | React.StatelessComponent<P>) =>
React.ComponentClass<Omit<P, keyof InjectedI18nProps | TTranslateFunctionName> & TranslateHocProps>;

export type InferableComponentEnhancerWithPropsAndRef<TTranslateFunctionName extends string> =
<P extends {}>(component: React.ComponentClass<P> | React.StatelessComponent<P>) =>
<P extends { [key: string]: any }>(component: React.ComponentClass<P> | React.StatelessComponent<P>) =>
WrapperComponentClass<Omit<P, keyof InjectedI18nProps | TTranslateFunctionName>, P>;

export interface Translate {
Expand Down
3 changes: 1 addition & 2 deletions types/react-redux/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ type Dispatch<A extends Redux.Action = Redux.AnyAction> = Redux.Dispatch<A>;
type ActionCreator<A> = Redux.ActionCreator<A>;

// Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766
type Diff<T extends string, U extends string> = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T];
type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;

export interface DispatchProp<A extends Redux.Action = Redux.AnyAction> {
dispatch?: Dispatch<A>;
Expand Down
4 changes: 1 addition & 3 deletions types/react-relay/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ import * as RelayRuntimeTypes from "relay-runtime";

// Taken from https://github.com/pelotom/type-zoo
// tslint:disable-next-line:strict-export-declare-modifiers
type Diff<T extends string, U extends string> = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T];
// tslint:disable-next-line:strict-export-declare-modifiers
type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;

export type RemoveRelayProp<P> = Omit<P & { relay: never }, "relay">;

Expand Down
3 changes: 1 addition & 2 deletions types/react-router/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ export interface match<P> {
}

// Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766
export type Diff<T extends string, U extends string> = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T];
export type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
export type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;

export function matchPath<P>(pathname: string, props: RouteProps): match<P> | null;

Expand Down
3 changes: 1 addition & 2 deletions types/recompose/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ declare module 'recompose' {
type predicateDiff<T> = (current: T, next: T) => boolean

// Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766
type Diff<T extends string, U extends string> = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T];
type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;

interface Observer<T>{
next(props: T): void;
Expand Down
3 changes: 1 addition & 2 deletions types/redux-form/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ export interface RegisteredFieldState {
type: FieldType;
}

export type Diff<T extends string, U extends string> = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T];
export type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
export type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;

export * from "./lib/reduxForm";
export * from "./lib/Field";
Expand Down