Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare TypeScript in data/visualizations plugin for 3.7 #47678

Merged
merged 1 commit into from
Oct 9, 2019
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
3 changes: 1 addition & 2 deletions src/legacy/core_plugins/data/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ export function plugin() {
// /// Export types & static code

/** @public types */
export type DataSetup = DataSetup;
export type DataStart = DataStart;
export { DataSetup, DataStart };

export { FilterBar, ApplyFiltersPopover } from './filter';
export {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,4 @@ export {
export type IndexPatternsSetup = ReturnType<IndexPatternsService['setup']>;

/** @public */
export type IndexPattern = IndexPattern;

/** @public */
export type IndexPatterns = IndexPatterns;

/** @public */
export type StaticIndexPattern = StaticIndexPattern;

/** @public */
export type Field = Field;

/** @public */
export type FieldType = FieldType;
export { IndexPattern, IndexPatterns, StaticIndexPattern, Field, FieldType };
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ import { PluginInitializerContext } from 'src/core/public';
import { VisualizationsPlugin, VisualizationsSetup, VisualizationsStart } from './plugin';

/** @public */
export type VisualizationsSetup = VisualizationsSetup;
export type VisualizationsStart = VisualizationsStart;
export { VisualizationsSetup, VisualizationsStart };

/** @public types */
export { VisTypeAlias, VisType } from './types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export type TypesSetup = ReturnType<TypesService['setup']>;
export type TypesStart = ReturnType<TypesService['start']>;

/** @public types */
export type VisTypeAlias = VisTypeAlias;
export { VisTypeAlias };

/** @public static code */
// TODO once items are moved from ui/vis into this service
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ const getFieldFormat = (id: string | undefined, params: object = {}) => {
}
};

export type FieldFormat = any;

export const createFormat = (agg: AggConfig): SerializedFieldFormat => {
const format: SerializedFieldFormat = agg.params.field ? agg.params.field.format.toJSON() : {};
const formats: Record<string, () => SerializedFieldFormat> = {
Expand Down Expand Up @@ -159,3 +157,5 @@ export const getTableAggs = (vis: Vis): AggConfig[] => {
const columns = tabifyGetColumns(vis.aggs.getResponseAggs(), !vis.isHierarchical());
return columns.map(c => c.aggConfig);
};

export { FieldFormat };
2 changes: 1 addition & 1 deletion src/plugins/data/common/field_formats/field_format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export abstract class FieldFormat {
};
}

static from(convertFn: FieldFormatConvertFunction) {
static from(convertFn: FieldFormatConvertFunction): ReturnType<typeof createCustomFieldFormat> {
return createCustomFieldFormat(convertFn);
}

Expand Down