/* * 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. */ declare module '@elastic/eui' { // @ts-ignore path only exists at build time export * from '@elastic/eui/src/components/common'; // eslint-disable-line import/no-unresolved // @ts-ignore path only exists at build time export * from '@elastic/eui/src/components/date_picker/react-datepicker'; // eslint-disable-line import/no-unresolved } /* * 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. */ declare module '@elastic/eui/dist/eui_theme_*.json' { const value: any; export default value; } /* * 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. */ /* eslint-disable @typescript-eslint/triple-slash-reference */ declare module '@elastic/eui/src/components/common' { import { AnchorHTMLAttributes, ButtonHTMLAttributes, Component, FunctionComponent, MouseEventHandler, SFC } from 'react'; export interface CommonProps { className?: string; 'aria-label'?: string; 'data-test-subj'?: string; } export type NoArgCallback = () => T; export const assertNever: (x: never) => never; /** * XOR for some properties applied to a type * (XOR is one of these but not both or neither) * * Usage: OneOf * * To require aria-label or aria-labelledby but not both * Example: OneOf */ export type OneOf = Omit & { [k in K]: Pick, k> & { [k1 in Exclude]?: never; }; }[K]; /** * Wraps Object.keys with proper typescript definition of the resulting array */ export function keysOf(obj: T): K[]; export type PropsOf = C extends SFC ? SFCProps : C extends FunctionComponent ? FunctionProps : C extends Component ? ComponentProps : never; type ExtractDefaultProps = T extends { defaultProps: infer D; } ? D : never; type ExtractProps any, IT = InstanceType> = IT extends Component ? P : never; /** * Because of how TypeScript's LibraryManagedAttributes is designed to handle defaultProps (https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-0.html#support-for-defaultprops-in-jsx) * we can't directly export the props definition as the defaulted values are not made optional, * because it isn't processed by LibraryManagedAttributes. To get around this, we: * - remove the props which have default values applied * - export (Props - Defaults) & Partial */ export type ApplyClassComponentDefaults any, D = ExtractDefaultProps, P = ExtractProps> = Omit & { [K in keyof D]?: K extends keyof P ? P[K] : never; }; type UnionKeys = T extends any ? keyof T : never; export type DistributivePick> = T extends any ? Pick> : never; export type DistributiveOmit> = T extends any ? Omit> : never; /** * Returns member keys in U not present in T set to never * T = { 'one', 'two', 'three' } * U = { 'three', 'four', 'five' } * returns { 'four': never, 'five': never } */ export type DisambiguateSet = { [P in Exclude]?: never; }; /** * Allow either T or U, preventing any additional keys of the other type from being present */ export type ExclusiveUnion = T | U extends object ? (DisambiguateSet & U) | (DisambiguateSet & T) : T | U; /** * For components that conditionally render