Skip to content

Commit

Permalink
[Typescript]: Move elastic/eui typings to single file
Browse files Browse the repository at this point in the history
* [Typescript]: Move elastic/eui typings to single file

* [Typescript]: Add typings folder to copyTask when building distributable
  • Loading branch information
sebelga authored Nov 23, 2018
1 parent 445ac2f commit 3717ff8
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 478 deletions.
1 change: 1 addition & 0 deletions src/dev/build/tasks/copy_source_task.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const CopySourceTask = {
'!src/functional_test_runner/**',
'!src/dev/**',
'bin/**',
'typings/**',
'webpackShims/**',
'config/kibana.yml',
'tsconfig*.json',
Expand Down
3 changes: 2 additions & 1 deletion src/dev/build/tasks/transpile_typescript_task.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export const TranspileTypescriptTask = {
...browserProject.config,
include: [
...browserProject.config.include,
'src/**/public/**/*'
'src/**/public/**/*',
'typings/**/*'
]
}));

Expand Down
4 changes: 0 additions & 4 deletions src/ui/public/query_bar/components/language_switcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
* under the License.
*/

declare module '@elastic/eui' {
export const EuiPopoverTitle: React.SFC<any>;
}

import {
EuiButtonEmpty,
EuiForm,
Expand Down
6 changes: 1 addition & 5 deletions src/ui/public/query_bar/components/query_bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@

import { IndexPattern } from 'ui/index_patterns';

declare module '@elastic/eui' {
export const EuiOutsideClickDetector: SFC<any>;
}

import { debounce, isEqual } from 'lodash';
import React, { Component, SFC } from 'react';
import React, { Component } from 'react';
import { getFromLegacyIndexPattern } from 'ui/index_patterns/static_utils';
import { kfetch } from 'ui/kfetch';
import { PersistedLog } from 'ui/persisted_log';
Expand Down
5 changes: 0 additions & 5 deletions src/ui/public/share/components/url_panel_content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
* under the License.
*/

// TODO: Remove once typescript definitions are in EUI
declare module '@elastic/eui' {
export const EuiCopy: React.SFC<any>;
}

import React, { Component } from 'react';

import {
Expand Down
5 changes: 0 additions & 5 deletions src/ui/public/share/show_share_context_menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
* under the License.
*/

// TODO: Remove once typescript definitions are in EUI
declare module '@elastic/eui' {
export const EuiWrappingPopover: React.SFC<any>;
}

import React from 'react';
import ReactDOM from 'react-dom';

Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"importHelpers": true
},
"include": [
"src/**/*"
"src/**/*",
"typings/**/*"
],
"exclude": [
"src/**/__fixtures__/**/*",
Expand Down
27 changes: 27 additions & 0 deletions typings/@elastic/eui/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

// TODO: Remove once typescript definitions are in EUI

declare module '@elastic/eui' {
export const EuiWrappingPopover: React.SFC<any>;
export const EuiCopy: React.SFC<any>;
export const EuiPopoverTitle: React.SFC<any>;
export const EuiOutsideClickDetector: React.SFC<any>;
}
Loading

0 comments on commit 3717ff8

Please sign in to comment.