From 74483631d09395de248fe97034c059a2a8bb2097 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 22 Jul 2018 16:22:19 +0200 Subject: Move frontend package types out of typescript-typings since this package will be used in both node and browser contexts --- packages/react-docs/src/globals.d.ts | 2 + packages/react-shared/src/globals.d.ts | 2 + packages/typescript-typings/package.json | 4 +- .../types/react-highlight/index.d.ts | 1 - .../types/react-popper/index.d.ts | 49 --------------------- .../types/react-tooltip/index.d.ts | 1 - packages/website/ts/globals.d.ts | 50 ++++++++++++++++++++++ 7 files changed, 56 insertions(+), 53 deletions(-) delete mode 100644 packages/typescript-typings/types/react-highlight/index.d.ts delete mode 100644 packages/typescript-typings/types/react-popper/index.d.ts delete mode 100644 packages/typescript-typings/types/react-tooltip/index.d.ts diff --git a/packages/react-docs/src/globals.d.ts b/packages/react-docs/src/globals.d.ts index 94e63a32d..12f976a3a 100644 --- a/packages/react-docs/src/globals.d.ts +++ b/packages/react-docs/src/globals.d.ts @@ -1,3 +1,5 @@ +declare module 'react-tooltip'; + declare module '*.json' { const json: any; /* tslint:disable */ diff --git a/packages/react-shared/src/globals.d.ts b/packages/react-shared/src/globals.d.ts index 94e63a32d..b633d045c 100644 --- a/packages/react-shared/src/globals.d.ts +++ b/packages/react-shared/src/globals.d.ts @@ -1,3 +1,5 @@ +declare module 'react-highlight'; + declare module '*.json' { const json: any; /* tslint:disable */ diff --git a/packages/typescript-typings/package.json b/packages/typescript-typings/package.json index fb5353a82..10435ff25 100644 --- a/packages/typescript-typings/package.json +++ b/packages/typescript-typings/package.json @@ -25,9 +25,9 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/typescript-typings#readme", "dependencies": { - "ethereum-types": "^1.0.0", + "@types/bn.js": "^4.11.0", "bignumber.js": "~4.1.0", - "@types/bn.js": "^4.11.0" + "ethereum-types": "^1.0.0" }, "devDependencies": { "@0xproject/monorepo-scripts": "^1.0.0", diff --git a/packages/typescript-typings/types/react-highlight/index.d.ts b/packages/typescript-typings/types/react-highlight/index.d.ts deleted file mode 100644 index 875721533..000000000 --- a/packages/typescript-typings/types/react-highlight/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare module 'react-highlight'; diff --git a/packages/typescript-typings/types/react-popper/index.d.ts b/packages/typescript-typings/types/react-popper/index.d.ts deleted file mode 100644 index d7dbca17f..000000000 --- a/packages/typescript-typings/types/react-popper/index.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Type definitions for react-popper 1.0.0-beta.6 -// Project: https://github.com/gilbarbara/react-joyride - -declare module 'react-popper' { - import * as React from 'react'; - import * as PopperJS from 'popper.js'; - - interface ManagerProps { - children: React.ReactNode; - } - export class Manager extends React.Component {} - - type RefHandler = (ref: HTMLElement | null) => void; - - export interface ReferenceChildrenProps { - ref: RefHandler; - } - - export interface ReferenceProps { - children: (props: ReferenceChildrenProps) => React.ReactNode; - } - export class Reference extends React.Component {} - - export interface PopperArrowProps { - ref: RefHandler; - style: React.CSSProperties; - } - - export type Placement = PopperJS.Placement; - - export interface PopperChildrenProps { - arrowProps: PopperArrowProps; - outOfBoundaries: boolean | null; - placement: PopperJS.Placement; - ref: RefHandler; - scheduleUpdate: () => void; - style: React.CSSProperties; - } - - export interface PopperProps { - children: (props: PopperChildrenProps) => React.ReactNode; - eventsEnabled?: boolean; - modifiers?: PopperJS.Modifiers; - placement?: PopperJS.Placement; - positionFixed?: boolean; - referenceElement?: Element; - } - export class Popper extends React.Component {} -} diff --git a/packages/typescript-typings/types/react-tooltip/index.d.ts b/packages/typescript-typings/types/react-tooltip/index.d.ts deleted file mode 100644 index 98cb6d592..000000000 --- a/packages/typescript-typings/types/react-tooltip/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare module 'react-tooltip'; diff --git a/packages/website/ts/globals.d.ts b/packages/website/ts/globals.d.ts index 719c2708a..a63089b51 100644 --- a/packages/website/ts/globals.d.ts +++ b/packages/website/ts/globals.d.ts @@ -3,6 +3,7 @@ declare module 'whatwg-fetch'; declare module 'thenby'; declare module 'react-document-title'; declare module 'react-ga'; +declare module 'react-tooltip'; declare module '*.json' { const json: any; @@ -17,3 +18,52 @@ interface System { import(module: string): Promise; } declare var System: System; + +// Type definitions for react-popper 1.0.0-beta.6 +// Project: https://github.com/gilbarbara/react-joyride +declare module 'react-popper' { + import * as React from 'react'; + import * as PopperJS from 'popper.js'; + + interface ManagerProps { + children: React.ReactNode; + } + export class Manager extends React.Component {} + + type RefHandler = (ref: HTMLElement | null) => void; + + export interface ReferenceChildrenProps { + ref: RefHandler; + } + + export interface ReferenceProps { + children: (props: ReferenceChildrenProps) => React.ReactNode; + } + export class Reference extends React.Component {} + + export interface PopperArrowProps { + ref: RefHandler; + style: React.CSSProperties; + } + + export type Placement = PopperJS.Placement; + + export interface PopperChildrenProps { + arrowProps: PopperArrowProps; + outOfBoundaries: boolean | null; + placement: PopperJS.Placement; + ref: RefHandler; + scheduleUpdate: () => void; + style: React.CSSProperties; + } + + export interface PopperProps { + children: (props: PopperChildrenProps) => React.ReactNode; + eventsEnabled?: boolean; + modifiers?: PopperJS.Modifiers; + placement?: PopperJS.Placement; + positionFixed?: boolean; + referenceElement?: Element; + } + export class Popper extends React.Component {} +} -- cgit v1.2.3