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

Ts 4 project references and incremental builds #72280

Closed
wants to merge 8 commits into from

Conversation

rudolf
Copy link
Contributor

@rudolf rudolf commented Jul 17, 2020

Developing Typescript with VSCode is currently frustratingly slow:

Opening files in another one of Kibana's 24 independent typescript projects sometimes takes > 60s "initializing TS language features"
cmd+clicking references within some projects takes > 60s (in my experience test seems to be the slowest)
Not all type errors show up under VSCode's "problems"
Running a complete typecheck takes > 60s which slows down the development cycle when doing large type refactors
I believe using [typescript references](https://www.typescriptlang.org/docs/handbook/project-references.html and incremental builds we should be able to make the build time much faster, have type errors show up without having to run scripts/type_check and improve type lookups and navigation in VSCode.

Summary

Blocked by: #71932
This is similar to #71736 but without any 3.9 type fixes (which comes from 3.9 having to emit declaration files). So this is probably the best place to start to further persue project references based on TS 4 beta.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@rudolf
Copy link
Contributor Author

rudolf commented Jul 17, 2020

It seems like eslint isn't happy with TS4, got the following error but didn't investigate:

ERROR 
      /Users/rudolf/dev/kibana/x-pack/plugins/apm/server/lib/traces/get_trace_items.ts
        0:0  error  Parsing error: Cannot read property 'map' of undefined
      
      /Users/rudolf/dev/kibana/x-pack/plugins/infra/public/utils/use_tracked_promise.ts
        0:0  error  Parsing error: Cannot read property 'map' of undefined
      
      /Users/rudolf/dev/kibana/x-pack/plugins/maps/public/connected_components/layer_panel/layer_settings/layer_settings.tsx
        0:0  error  Parsing error: Cannot read property 'map' of undefined
      
      /Users/rudolf/dev/kibana/x-pack/plugins/security_solution/common/endpoint/types.ts
        0:0  error  Parsing error: Cannot read property 'map' of undefined
      
      ✖ 4 problems (4 errors, 0 warnings)

@rudolf rudolf added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Jul 17, 2020
@rudolf
Copy link
Contributor Author

rudolf commented Jul 17, 2020

Causes 34 type errors:

src/core/server/capabilities/resolve_capabilities.ts:48:21 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string', gave the following error.
    Type '{ [x: string]: boolean | undefined; }' is not assignable to type 'string'.
  Overload 2 of 3, '(callbackfn: (previousValue: Record<string, boolean>, currentValue: string, currentIndex: number, array: string[]) => Record<string, boolean>, initialValue: Record<string, boolean>): Record<...>', gave the following error.
    Type '{ [x: string]: boolean | undefined; }' is not assignable to type 'Record<string, boolean>'.
      Index signatures are incompatible.
        Type 'boolean | undefined' is not assignable to type 'boolean'.
          Type 'undefined' is not assignable to type 'boolean'.

48       (acc, app) => ({
                       ~~
49         ...acc,
   ~~~~~~~~~~~~~~~
50         [app]: true,
   ~~~~~~~~~~~~~~~~~~~~
51       }),
   ~~~~~~~~

  node_modules/typescript/lib/lib.es5.d.ts:1368:24
    1368     reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.
  node_modules/typescript/lib/lib.es5.d.ts:1374:27
    1374     reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.

src/core/server/capabilities/resolve_capabilities.ts:55:3 - error TS2322: Type '{ navLinks: string; management: { [sectionId: string]: Record<string, boolean>; }; catalogue: Record<string, boolean>; }' is not assignable to type 'Capabilities'.

 55   return switchers.reduce(async (caps, switcher) => {
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 56     const resolvedCaps = await caps;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... 
 58     return recursiveApplyChanges(resolvedCaps, changes);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 59   }, Promise.resolve(mergedCaps));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/core/server/capabilities/resolve_capabilities.ts:57:45 - error TS2345: Argument of type '{ navLinks: string; management: { [sectionId: string]: Record<string, boolean>; }; catalogue: Record<string, boolean>; }' is not assignable to parameter of type 'Capabilities'.
  Types of property 'navLinks' are incompatible.
    Type 'string' is not assignable to type 'Record<string, boolean>'.

57     const changes = await switcher(request, resolvedCaps);
                                               ~~~~~~~~~~~~

src/plugins/expressions/common/executor/container.ts:46:48 - error TS2322: Type '{ [x: string]: ExpressionFunction | undefined; }' is not assignable to type 'Record<string, ExpressionFunction>'.
  Index signatures are incompatible.
    Type 'ExpressionFunction | undefined' is not assignable to type 'ExpressionFunction'.
      Type 'undefined' is not assignable to type 'ExpressionFunction'.

46   addFunction: (state) => (fn) => ({ ...state, functions: { ...state.functions, [fn.name]: fn } }),
                                                  ~~~~~~~~~

  src/plugins/expressions/common/executor/container.ts:28:3
    28   functions: Record<string, ExpressionFunction>;
         ~~~~~~~~~
    The expected type comes from property 'functions' which is declared here on type 'ExecutorState<Record<string, unknown>>'

src/plugins/expressions/common/executor/container.ts:47:46 - error TS2322: Type '{ [x: string]: ExpressionType | undefined; }' is not assignable to type 'Record<string, ExpressionType>'.
  Index signatures are incompatible.
    Type 'ExpressionType | undefined' is not assignable to type 'ExpressionType'.
      Type 'undefined' is not assignable to type 'ExpressionType'.

47   addType: (state) => (type) => ({ ...state, types: { ...state.types, [type.name]: type } }),
                                                ~~~~~

  src/plugins/expressions/common/executor/container.ts:29:3
    29   types: Record<string, ExpressionType>;
         ~~~~~
    The expected type comes from property 'types' which is declared here on type 'ExecutorState<Record<string, unknown>>'

src/plugins/expressions/common/expression_renderers/expression_renderer_registry.ts:41:5 - error TS2322: Type 'ExpressionRenderer<unknown>' is not assignable to type 'Record<string, ExpressionRenderer<unknown>>'.
  Index signature is missing in type 'ExpressionRenderer<unknown>'.

 41     return this.toArray().reduce(
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 42       (acc, renderer) => ({
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
... 
 46       {} as Record<string, ExpressionRenderer>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 47     );
    ~~~~~~

src/plugins/expressions/common/expression_renderers/expression_renderer_registry.ts:42:26 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(callbackfn: (previousValue: ExpressionRenderer<unknown>, currentValue: ExpressionRenderer<unknown>, currentIndex: number, array: ExpressionRenderer<unknown>[]) => ExpressionRenderer<...>, initialValue: ExpressionRenderer<...>): ExpressionRenderer<...>', gave the following error.
    Type '{ [x: string]: ExpressionRenderer<unknown> | undefined; }' is missing the following properties from type 'ExpressionRenderer<unknown>': name, displayName, help, validate, and 2 more.
  Overload 2 of 3, '(callbackfn: (previousValue: Record<string, ExpressionRenderer<unknown>>, currentValue: ExpressionRenderer<unknown>, currentIndex: number, array: ExpressionRenderer<unknown>[]) => Record<...>, initialValue: Record<...>): Record<...>', gave the following error.
    Type '{ [x: string]: ExpressionRenderer<unknown> | undefined; }' is not assignable to type 'Record<string, ExpressionRenderer<unknown>>'.
      Index signatures are incompatible.
        Type 'ExpressionRenderer<unknown> | undefined' is not assignable to type 'ExpressionRenderer<unknown>'.
          Type 'undefined' is not assignable to type 'ExpressionRenderer<unknown>'.

42       (acc, renderer) => ({
                            ~~
43         ...acc,
   ~~~~~~~~~~~~~~~
44         [renderer.name]: renderer,
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45       }),
   ~~~~~~~~

  node_modules/typescript/lib/lib.es5.d.ts:1368:24
    1368     reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.
  node_modules/typescript/lib/lib.es5.d.ts:1374:27
    1374     reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.

src/core/server/saved_objects/migrations/core/document_migrator.ts:209:3 - error TS2322: Type 'SavedObjectsType' is not assignable to type 'ActiveMigrations'.

209   return typeRegistry
      ~~~~~~~~~~~~~~~~~~~
210     .getAllTypes()
    ~~~~~~~~~~~~~~~~~~
... 
225       };
    ~~~~~~~~
226     }, {} as ActiveMigrations);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/core/server/saved_objects/migrations/core/document_migrator.ts:212:13 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(callbackfn: (previousValue: SavedObjectsType, currentValue: SavedObjectsType, currentIndex: number, array: SavedObjectsType[]) => SavedObjectsType, initialValue: SavedObjectsType): SavedObjectsType', gave the following error.
    Argument of type '(migrations: ActiveMigrations, type: SavedObjectsType) => { [x: string]: { latestVersion: string; transforms: { version: string; transform: TransformFn; }[]; } | undefined; }' is not assignable to parameter of type '(previousValue: SavedObjectsType, currentValue: SavedObjectsType, currentIndex: number, array: SavedObjectsType[]) => SavedObjectsType'.
      Types of parameters 'migrations' and 'previousValue' are incompatible.
        Type 'SavedObjectsType' is not assignable to type 'ActiveMigrations'.
          Index signature is missing in type 'SavedObjectsType'.
  Overload 2 of 3, '(callbackfn: (previousValue: ActiveMigrations, currentValue: SavedObjectsType, currentIndex: number, array: SavedObjectsType[]) => ActiveMigrations, initialValue: ActiveMigrations): ActiveMigrations', gave the following error.
    Argument of type '(migrations: ActiveMigrations, type: SavedObjectsType) => { [x: string]: { latestVersion: string; transforms: { version: string; transform: TransformFn; }[]; } | undefined; }' is not assignable to parameter of type '(previousValue: ActiveMigrations, currentValue: SavedObjectsType, currentIndex: number, array: SavedObjectsType[]) => ActiveMigrations'.
      Type '{ [x: string]: { latestVersion: string; transforms: { version: string; transform: TransformFn; }[]; } | undefined; }' is not assignable to type 'ActiveMigrations'.
        Index signatures are incompatible.
          Type '{ latestVersion: string; transforms: { version: string; transform: TransformFn; }[]; } | undefined' is not assignable to type '{ latestVersion: string; transforms: { version: string; transform: TransformFn; }[]; }'.
            Type 'undefined' is not assignable to type '{ latestVersion: string; transforms: { version: string; transform: TransformFn; }[]; }'.

212     .reduce((migrations, type) => {
                ~~~~~~~~~~~~~~~~~~~~~~~


src/core/server/saved_objects/migrations/core/document_migrator.ts:375:5 - error TS2322: Type '{ [x: string]: string | undefined; }' is not assignable to type 'SavedObjectsMigrationVersion'.
  Index signatures are incompatible.
    Type 'string | undefined' is not assignable to type 'string'.
      Type 'undefined' is not assignable to type 'string'.

375     migrationVersion = updateMigrationVersion(doc, migrationVersion, prop, version);
        ~~~~~~~~~~~~~~~~

src/core/server/saved_objects/utils.ts:81:3 - error TS2322: Type 'SavedObjectsType' is not assignable to type 'SavedObjectsSchemaDefinition'.

 81   return types.reduce((schema, type) => {
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 82     return {
    ~~~~~~~~~~~~
... 
 91     };
    ~~~~~~
 92   }, {} as SavedObjectsSchemaDefinition);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/core/server/saved_objects/utils.ts:81:23 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(callbackfn: (previousValue: SavedObjectsType, currentValue: SavedObjectsType, currentIndex: number, array: SavedObjectsType[]) => SavedObjectsType, initialValue: SavedObjectsType): SavedObjectsType', gave the following error.
    Argument of type '(schema: SavedObjectsSchemaDefinition, type: SavedObjectsType) => { [x: string]: SavedObjectsSchemaTypeDefinition | undefined; }' is not assignable to parameter of type '(previousValue: SavedObjectsType, currentValue: SavedObjectsType, currentIndex: number, array: SavedObjectsType[]) => SavedObjectsType'.
      Types of parameters 'schema' and 'previousValue' are incompatible.
        Type 'SavedObjectsType' is not assignable to type 'SavedObjectsSchemaDefinition'.
          Index signature is missing in type 'SavedObjectsType'.
  Overload 2 of 3, '(callbackfn: (previousValue: SavedObjectsSchemaDefinition, currentValue: SavedObjectsType, currentIndex: number, array: SavedObjectsType[]) => SavedObjectsSchemaDefinition, initialValue: SavedObjectsSchemaDefinition): SavedObjectsSchemaDefinition', gave the following error.
    Argument of type '(schema: SavedObjectsSchemaDefinition, type: SavedObjectsType) => { [x: string]: SavedObjectsSchemaTypeDefinition | undefined; }' is not assignable to parameter of type '(previousValue: SavedObjectsSchemaDefinition, currentValue: SavedObjectsType, currentIndex: number, array: SavedObjectsType[]) => SavedObjectsSchemaDefinition'.
      Type '{ [x: string]: SavedObjectsSchemaTypeDefinition | undefined; }' is not assignable to type 'SavedObjectsSchemaDefinition'.
        Index signatures are incompatible.
          Type 'SavedObjectsSchemaTypeDefinition | undefined' is not assignable to type 'SavedObjectsSchemaTypeDefinition'.
            Type 'undefined' is not assignable to type 'SavedObjectsSchemaTypeDefinition'.

81   return types.reduce((schema, type) => {
                         ~~~~~~~~~~~~~~~~~~~


src/core/server/saved_objects/utils.ts:98:3 - error TS2322: Type '[string, SavedObjectLegacyMigrationFn]' is not assignable to type 'SavedObjectMigrationMap'.

 98   return Object.entries(legacyMigrations).reduce((migrated, [version, migrationFn]) => {
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 99     return {
    ~~~~~~~~~~~~
... 
102     };
    ~~~~~~
103   }, {} as SavedObjectMigrationMap);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/core/server/saved_objects/utils.ts:98:50 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(callbackfn: (previousValue: [string, SavedObjectLegacyMigrationFn], currentValue: [string, SavedObjectLegacyMigrationFn], currentIndex: number, array: [...][]) => [...], initialValue: [...]): [...]', gave the following error.
    Argument of type '(migrated: SavedObjectMigrationMap, [version, migrationFn]: [string, SavedObjectLegacyMigrationFn]) => { [x: string]: SavedObjectMigrationFn<any, any> | undefined; }' is not assignable to parameter of type '(previousValue: [string, SavedObjectLegacyMigrationFn], currentValue: [string, SavedObjectLegacyMigrationFn], currentIndex: number, array: [...][]) => [...]'.
      Types of parameters 'migrated' and 'previousValue' are incompatible.
        Type '[string, SavedObjectLegacyMigrationFn]' is not assignable to type 'SavedObjectMigrationMap'.
          Index signature is missing in type '[string, SavedObjectLegacyMigrationFn]'.
  Overload 2 of 3, '(callbackfn: (previousValue: SavedObjectMigrationMap, currentValue: [string, SavedObjectLegacyMigrationFn], currentIndex: number, array: [...][]) => SavedObjectMigrationMap, initialValue: SavedObjectMigrationMap): SavedObjectMigrationMap', gave the following error.
    Argument of type '(migrated: SavedObjectMigrationMap, [version, migrationFn]: [string, SavedObjectLegacyMigrationFn]) => { [x: string]: SavedObjectMigrationFn<any, any> | undefined; }' is not assignable to parameter of type '(previousValue: SavedObjectMigrationMap, currentValue: [string, SavedObjectLegacyMigrationFn], currentIndex: number, array: [...][]) => SavedObjectMigrationMap'.
      Type '{ [x: string]: SavedObjectMigrationFn<any, any> | undefined; }' is not assignable to type 'SavedObjectMigrationMap'.
        Index signatures are incompatible.
          Type 'SavedObjectMigrationFn<any, any> | undefined' is not assignable to type 'SavedObjectMigrationFn<any, any>'.
            Type 'undefined' is not assignable to type 'SavedObjectMigrationFn<any, any>'.

98   return Object.entries(legacyMigrations).reduce((migrated, [version, migrationFn]) => {
                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


src/plugins/share/public/components/url_panel_content.tsx:451:21 - error TS2345: Argument of type '{ urlParams: { [x: string]: { [queryParam: string]: boolean; } | undefined; }; }' is not assignable to parameter of type 'State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, "urlParams"> | null) | Pick<...> | null'.
  Type '{ urlParams: { [x: string]: { [queryParam: string]: boolean; } | undefined; }; }' is not assignable to type 'Pick<State, "urlParams">'.
    Types of property 'urlParams' are incompatible.
      Type '{ [x: string]: { [queryParam: string]: boolean; } | undefined; }' is not assignable to type 'UrlParams'.
        Index signatures are incompatible.
          Type '{ [queryParam: string]: boolean; } | undefined' is not assignable to type '{ [queryParam: string]: boolean; }'.
            Type 'undefined' is not assignable to type '{ [queryParam: string]: boolean; }'.

451       this.setState(stateUpdate, this.state.useShortUrl ? this.createShortUrl : this.setUrl);
                        ~~~~~~~~~~~

src/plugins/share/public/components/share_context_menu.tsx:158:20 - error TS2790: The operand of a 'delete' operator must be optional.

158             delete menuItem.sortOrder;
                       ~~~~~~~~~~~~~~~~~~

src/plugins/vis_default_editor/public/components/agg_group_state.tsx:47:7 - error TS2322: Type '{ [x: string]: AggsItem | undefined; }' is not assignable to type 'AggsState'.
  Index signatures are incompatible.
    Type 'AggsItem | undefined' is not assignable to type 'AggsItem'.
      Type 'undefined' is not assignable to type 'AggsItem'.

47       return { ...state, [action.aggId]: { ...aggState, touched: action.payload } };
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/vis_default_editor/public/components/agg_group_state.tsx:49:7 - error TS2322: Type '{ [x: string]: AggsItem | undefined; }' is not assignable to type 'AggsState'.
  Index signatures are incompatible.
    Type 'AggsItem | undefined' is not assignable to type 'AggsItem'.
      Type 'undefined' is not assignable to type 'AggsItem'.

49       return { ...state, [action.aggId]: { ...aggState, valid: action.payload } };
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/vis_default_editor/public/components/controls/components/input_list.tsx:119:9 - error TS2345: Argument of type '{ [x: string]: InputItem | undefined; id: string; }[]' is not assignable to parameter of type 'InputModel[]'.
  Type '{ [x: string]: InputItem | undefined; id: string; }' is not assignable to type 'InputModel'.
    Type '{ [x: string]: InputItem | undefined; id: string; }' is not assignable to type 'InputItemModel'.
      Index signatures are incompatible.
        Type 'InputItem | undefined' is not assignable to type 'InputItem'.
          Type 'undefined' is not assignable to type 'InputItem'.

119         models.map((range, arrayIndex) =>
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120           arrayIndex === index
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... 
129             : range
    ~~~~~~~~~~~~~~~~~~~
130         )
    ~~~~~~~~~

src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx:157:7 - error TS2322: Type '{ [x: string]: DashboardPanelState<EmbeddableInput & { [k: string]: unknown; }> | undefined; }' is not assignable to type '{ [panelId: string]: DashboardPanelState<EmbeddableInput & { [k: string]: unknown; }>; }'.
  Index signatures are incompatible.
    Type 'DashboardPanelState<EmbeddableInput & { [k: string]: unknown; }> | undefined' is not assignable to type 'DashboardPanelState<EmbeddableInput & { [k: string]: unknown; }>'.
      Type 'undefined' is not assignable to type 'DashboardPanelState<EmbeddableInput & { [k: string]: unknown; }>'.

157       panels: {
          ~~~~~~

  src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx:63:3
    63   panels: {
         ~~~~~~
    The expected type comes from property 'panels' which is declared here on type 'Partial<DashboardContainerInput>'

src/plugins/saved_objects_management/public/management_section/object_view/components/form.tsx:135:7 - error TS2322: Type '{ [x: string]: FieldState | undefined; }' is not assignable to type 'Record<string, FieldState>'.
  Index signatures are incompatible.
    Type 'FieldState | undefined' is not assignable to type 'FieldState'.
      Type 'undefined' is not assignable to type 'FieldState'.

135       fieldStates: {
          ~~~~~~~~~~~

src/plugins/dashboard/public/application/dashboard_app_controller.tsx:440:24 - error TS2790: The operand of a 'delete' operator must be optional.

440                 delete input.id;
                           ~~~~~~~~

src/plugins/dashboard/server/saved_objects/migrations_730.ts:65:12 - error TS2790: The operand of a 'delete' operator must be optional.

65     delete doc.attributes.uiStateJSON;
              ~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/kibana_usage_collection/server/collectors/ui_metric/telemetry_ui_metric_collector.ts:63:54 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(callbackfn: (previousValue: SavedObject<UIMetricsSavedObjects>, currentValue: SavedObject<UIMetricsSavedObjects>, currentIndex: number, array: SavedObject<...>[]) => SavedObject<...>, initialValue: SavedObject<...>): SavedObject<...>', gave the following error.
    Argument of type '(accum: Record<string, { key: string; value: number; }[]>, rawUiMetric: SavedObject<UIMetricsSavedObjects>) => { [x: string]: { key: string; value: number; }[] | undefined; }' is not assignable to parameter of type '(previousValue: SavedObject<UIMetricsSavedObjects>, currentValue: SavedObject<UIMetricsSavedObjects>, currentIndex: number, array: SavedObject<...>[]) => SavedObject<...>'.
      Types of parameters 'accum' and 'previousValue' are incompatible.
        Type 'SavedObject<UIMetricsSavedObjects>' is not assignable to type 'Record<string, { key: string; value: number; }[]>'.
          Index signature is missing in type 'SavedObject<UIMetricsSavedObjects>'.
  Overload 2 of 3, '(callbackfn: (previousValue: Record<string, { key: string; value: number; }[]>, currentValue: SavedObject<UIMetricsSavedObjects>, currentIndex: number, array: SavedObject<...>[]) => Record<...>, initialValue: Record<...>): Record<...>', gave the following error.
    Argument of type '(accum: Record<string, { key: string; value: number; }[]>, rawUiMetric: SavedObject<UIMetricsSavedObjects>) => { [x: string]: { key: string; value: number; }[] | undefined; }' is not assignable to parameter of type '(previousValue: Record<string, { key: string; value: number; }[]>, currentValue: SavedObject<UIMetricsSavedObjects>, currentIndex: number, array: SavedObject<...>[]) => Record<...>'.
      Type '{ [x: string]: { key: string; value: number; }[] | undefined; }' is not assignable to type 'Record<string, { key: string; value: number; }[]>'.
        Index signatures are incompatible.
          Type '{ key: string; value: number; }[] | undefined' is not assignable to type '{ key: string; value: number; }[]'.
            Type 'undefined' is not assignable to type '{ key: string; value: number; }[]'.

63       const uiMetricsByAppName = rawUiMetrics.reduce((accum, rawUiMetric) => {
                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~


src/plugins/kibana_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.ts:79:9 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(callbackfn: (previousValue: SavedObject<ApplicationUsageTotal>, currentValue: SavedObject<ApplicationUsageTotal>, currentIndex: number, array: SavedObject<...>[]) => SavedObject<...>, initialValue: SavedObject<...>): SavedObject<...>', gave the following error.
    Argument of type '(acc: ApplicationUsageTelemetryReport, { attributes: { appId, minutesOnScreen, numberOfClicks } }: SavedObject<ApplicationUsageTotal>) => { [x: string]: { clicks_total: number; ... 6 more ...; minutes_on_screen_90_days: number; } | undefined; }' is not assignable to parameter of type '(previousValue: SavedObject<ApplicationUsageTotal>, currentValue: SavedObject<ApplicationUsageTotal>, currentIndex: number, array: SavedObject<...>[]) => SavedObject<...>'.
      Types of parameters 'acc' and 'previousValue' are incompatible.
        Type 'SavedObject<ApplicationUsageTotal>' is not assignable to type 'ApplicationUsageTelemetryReport'.
          Index signature is missing in type 'SavedObject<ApplicationUsageTotal>'.
  Overload 2 of 3, '(callbackfn: (previousValue: ApplicationUsageTelemetryReport, currentValue: SavedObject<ApplicationUsageTotal>, currentIndex: number, array: SavedObject<...>[]) => ApplicationUsageTelemetryReport, initialValue: ApplicationUsageTelemetryReport): ApplicationUsageTelemetryReport', gave the following error.
    Argument of type '(acc: ApplicationUsageTelemetryReport, { attributes: { appId, minutesOnScreen, numberOfClicks } }: SavedObject<ApplicationUsageTotal>) => { [x: string]: { clicks_total: number; ... 6 more ...; minutes_on_screen_90_days: number; } | undefined; }' is not assignable to parameter of type '(previousValue: ApplicationUsageTelemetryReport, currentValue: SavedObject<ApplicationUsageTotal>, currentIndex: number, array: SavedObject<...>[]) => ApplicationUsageTelemetryReport'.
      Type '{ [x: string]: { clicks_total: number; clicks_7_days: number; clicks_30_days: number; clicks_90_days: number; minutes_on_screen_total: number; minutes_on_screen_7_days: number; minutes_on_screen_30_days: number; minutes_on_screen_90_days: number; } | undefined; }' is not assignable to type 'ApplicationUsageTelemetryReport'.
        Index signatures are incompatible.
          Type '{ clicks_total: number; clicks_7_days: number; clicks_30_days: number; clicks_90_days: number; minutes_on_screen_total: number; minutes_on_screen_7_days: number; minutes_on_screen_30_days: number; minutes_on_screen_90_days: number; } | undefined' is not assignable to type '{ clicks_total: number; clicks_7_days: number; clicks_30_days: number; clicks_90_days: number; minutes_on_screen_total: number; minutes_on_screen_7_days: number; minutes_on_screen_30_days: number; minutes_on_screen_90_days: number; }'.
            Type 'undefined' is not assignable to type '{ clicks_total: number; clicks_7_days: number; clicks_30_days: number; clicks_90_days: number; minutes_on_screen_total: number; minutes_on_screen_7_days: number; minutes_on_screen_30_days: number; minutes_on_screen_90_days: number; }'.

79         (acc, { attributes: { appId, minutesOnScreen, numberOfClicks } }) => {
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


src/plugins/kibana_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.ts:103:28 - error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'SavedObject<ApplicationUsageTotal>'.
  No index signature with a parameter of type 'string' was found on type 'SavedObject<ApplicationUsageTotal>'.

103           const existing = acc[appId] || {
                               ~~~~~~~~~~

src/plugins/kibana_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.ts:172:7 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(callbackfn: (previousValue: SavedObject<ApplicationUsageTotal>, currentValue: SavedObject<ApplicationUsageTotal>, currentIndex: number, array: SavedObject<...>[]) => SavedObject<...>, initialValue: SavedObject<...>): SavedObject<...>', gave the following error.
    Argument of type '(acc: Record<string, { appId: string; minutesOnScreen: number; numberOfClicks: number; }>, { attributes: { appId, numberOfClicks, minutesOnScreen } }: SavedObject<ApplicationUsageTotal>) => { ...; }' is not assignable to parameter of type '(previousValue: SavedObject<ApplicationUsageTotal>, currentValue: SavedObject<ApplicationUsageTotal>, currentIndex: number, array: SavedObject<...>[]) => SavedObject<...>'.
      Types of parameters 'acc' and 'previousValue' are incompatible.
        Type 'SavedObject<ApplicationUsageTotal>' is not assignable to type 'Record<string, { appId: string; minutesOnScreen: number; numberOfClicks: number; }>'.
          Index signature is missing in type 'SavedObject<ApplicationUsageTotal>'.
  Overload 2 of 3, '(callbackfn: (previousValue: Record<string, { appId: string; minutesOnScreen: number; numberOfClicks: number; }>, currentValue: SavedObject<ApplicationUsageTotal>, currentIndex: number, array: SavedObject<...>[]) => Record<...>, initialValue: Record<...>): Record<...>', gave the following error.
    Argument of type '(acc: Record<string, { appId: string; minutesOnScreen: number; numberOfClicks: number; }>, { attributes: { appId, numberOfClicks, minutesOnScreen } }: SavedObject<ApplicationUsageTotal>) => { ...; }' is not assignable to parameter of type '(previousValue: Record<string, { appId: string; minutesOnScreen: number; numberOfClicks: number; }>, currentValue: SavedObject<ApplicationUsageTotal>, currentIndex: number, array: SavedObject<...>[]) => Record<...>'.
      Type '{ [x: string]: { appId: string; minutesOnScreen: number; numberOfClicks: number; } | undefined; }' is not assignable to type 'Record<string, { appId: string; minutesOnScreen: number; numberOfClicks: number; }>'.
        Index signatures are incompatible.
          Type '{ appId: string; minutesOnScreen: number; numberOfClicks: number; } | undefined' is not assignable to type '{ appId: string; minutesOnScreen: number; numberOfClicks: number; }'.
            Type 'undefined' is not assignable to type '{ appId: string; minutesOnScreen: number; numberOfClicks: number; }'.

172       (acc, { attributes: { appId, numberOfClicks, minutesOnScreen } }) => {
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


src/plugins/kibana_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.ts:185:24 - error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'SavedObject<ApplicationUsageTotal>'.
  No index signature with a parameter of type 'string' was found on type 'SavedObject<ApplicationUsageTotal>'.

185       const existing = acc[appId] || { minutesOnScreen: 0, numberOfClicks: 0 };
                           ~~~~~~~~~~

src/plugins/kibana_usage_collection/server/collectors/kibana/get_saved_object_counts.ts:78:3 - error TS2322: Type '{ key: string; doc_count: number; }' is not assignable to type 'KibanaSavedObjectCounts'.
  Property 'key' is incompatible with index signature.
    Type 'string' is not assignable to type '{ total: number; }'.

78   return buckets.reduce(
     ~~~~~~~~~~~~~~~~~~~~~~
79     (acc, { key, doc_count: total }) => (total ? { ...acc, [snakeCase(key)]: { total } } : acc),
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
80     allZeros
   ~~~~~~~~~~~~
81   );
   ~~~~

src/plugins/kibana_usage_collection/server/collectors/kibana/get_saved_object_counts.ts:79:41 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(callbackfn: (previousValue: { key: string; doc_count: number; }, currentValue: { key: string; doc_count: number; }, currentIndex: number, array: { key: string; doc_count: number; }[]) => { key: string; doc_count: number; }, initialValue: { ...; }): { ...; }', gave the following error.
    Type '{ [x: string]: { total: number; } | undefined; }' is missing the following properties from type '{ key: string; doc_count: number; }': key, doc_count
  Overload 2 of 3, '(callbackfn: (previousValue: KibanaSavedObjectCounts, currentValue: { key: string; doc_count: number; }, currentIndex: number, array: { key: string; doc_count: number; }[]) => KibanaSavedObjectCounts, initialValue: KibanaSavedObjectCounts): KibanaSavedObjectCounts', gave the following error.
    Type '{ [x: string]: { total: number; } | undefined; }' is not assignable to type 'KibanaSavedObjectCounts'.
      Index signatures are incompatible.
        Type '{ total: number; } | undefined' is not assignable to type '{ total: number; }'.
          Type 'undefined' is not assignable to type '{ total: number; }'.

79     (acc, { key, doc_count: total }) => (total ? { ...acc, [snakeCase(key)]: { total } } : acc),
                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.es5.d.ts:1368:24
    1368     reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.
  node_modules/typescript/lib/lib.es5.d.ts:1374:27
    1374     reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.

src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts:46:12 - error TS2790: The operand of a 'delete' operator must be optional.

46     delete metrics.process.pid;
              ~~~~~~~~~~~~~~~~~~~

src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts:51:12 - error TS2790: The operand of a 'delete' operator must be optional.

51     delete metrics.requests.statusCodes;
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/vis_type_vislib/public/components/common/validation_wrapper.tsx:45:19 - error TS2345: Argument of type '(state: { [key: string]: Item; }) => { [x: string]: Item | undefined; }' is not assignable to parameter of type 'SetStateAction<{ [key: string]: Item; }>'.
  Type '(state: { [key: string]: Item; }) => { [x: string]: Item | undefined; }' is not assignable to type '(prevState: { [key: string]: Item; }) => { [key: string]: Item; }'.
    Type '{ [x: string]: Item | undefined; }' is not assignable to type '{ [key: string]: Item; }'.
      Index signatures are incompatible.
        Type 'Item | undefined' is not assignable to type 'Item'.
          Type 'undefined' is not assignable to type 'Item'.

 45     setPanelState((state) => ({
                      ~~~~~~~~~~~~~
 46       ...state,
    ~~~~~~~~~~~~~~~
... 
 49       },
    ~~~~~~~~
 50     }));
    ~~~~~~

src/plugins/vis_type_vislib/public/vislib/helpers/point_series/point_series.ts:116:10 - error TS2790: The operand of a 'delete' operator must be optional.

116   delete chart.aspects;
             ~~~~~~~~~~~~~


Found 34 errors.


real    0m53.106s
user    1m9.202s
sys     0m3.272s
rudolf-elastic-mbp:kibana rudolf$ time NODE_OPTIONS=--max-old-space-size=8000 ./node_modules/.bin/tsc -b tsconfig.json --force
src/core/server/capabilities/resolve_capabilities.ts:48:21 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string', gave the following error.
    Type '{ [x: string]: boolean | undefined; }' is not assignable to type 'string'.
  Overload 2 of 3, '(callbackfn: (previousValue: Record<string, boolean>, currentValue: string, currentIndex: number, array: string[]) => Record<string, boolean>, initialValue: Record<string, boolean>): Record<...>', gave the following error.
    Type '{ [x: string]: boolean | undefined; }' is not assignable to type 'Record<string, boolean>'.
      Index signatures are incompatible.
        Type 'boolean | undefined' is not assignable to type 'boolean'.
          Type 'undefined' is not assignable to type 'boolean'.

48       (acc, app) => ({
                       ~~
49         ...acc,
   ~~~~~~~~~~~~~~~
50         [app]: true,
   ~~~~~~~~~~~~~~~~~~~~
51       }),
   ~~~~~~~~

  node_modules/typescript/lib/lib.es5.d.ts:1368:24
    1368     reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.
  node_modules/typescript/lib/lib.es5.d.ts:1374:27
    1374     reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.

src/core/server/capabilities/resolve_capabilities.ts:55:3 - error TS2322: Type '{ navLinks: string; management: { [sectionId: string]: Record<string, boolean>; }; catalogue: Record<string, boolean>; }' is not assignable to type 'Capabilities'.

 55   return switchers.reduce(async (caps, switcher) => {
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 56     const resolvedCaps = await caps;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... 
 58     return recursiveApplyChanges(resolvedCaps, changes);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 59   }, Promise.resolve(mergedCaps));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/core/server/capabilities/resolve_capabilities.ts:57:45 - error TS2345: Argument of type '{ navLinks: string; management: { [sectionId: string]: Record<string, boolean>; }; catalogue: Record<string, boolean>; }' is not assignable to parameter of type 'Capabilities'.
  Types of property 'navLinks' are incompatible.
    Type 'string' is not assignable to type 'Record<string, boolean>'.

57     const changes = await switcher(request, resolvedCaps);
                                               ~~~~~~~~~~~~

src/plugins/expressions/common/executor/container.ts:46:48 - error TS2322: Type '{ [x: string]: ExpressionFunction | undefined; }' is not assignable to type 'Record<string, ExpressionFunction>'.
  Index signatures are incompatible.
    Type 'ExpressionFunction | undefined' is not assignable to type 'ExpressionFunction'.
      Type 'undefined' is not assignable to type 'ExpressionFunction'.

46   addFunction: (state) => (fn) => ({ ...state, functions: { ...state.functions, [fn.name]: fn } }),
                                                  ~~~~~~~~~

  src/plugins/expressions/common/executor/container.ts:28:3
    28   functions: Record<string, ExpressionFunction>;
         ~~~~~~~~~
    The expected type comes from property 'functions' which is declared here on type 'ExecutorState<Record<string, unknown>>'

src/plugins/expressions/common/executor/container.ts:47:46 - error TS2322: Type '{ [x: string]: ExpressionType | undefined; }' is not assignable to type 'Record<string, ExpressionType>'.
  Index signatures are incompatible.
    Type 'ExpressionType | undefined' is not assignable to type 'ExpressionType'.
      Type 'undefined' is not assignable to type 'ExpressionType'.

47   addType: (state) => (type) => ({ ...state, types: { ...state.types, [type.name]: type } }),
                                                ~~~~~

  src/plugins/expressions/common/executor/container.ts:29:3
    29   types: Record<string, ExpressionType>;
         ~~~~~
    The expected type comes from property 'types' which is declared here on type 'ExecutorState<Record<string, unknown>>'

src/plugins/expressions/common/expression_renderers/expression_renderer_registry.ts:41:5 - error TS2322: Type 'ExpressionRenderer<unknown>' is not assignable to type 'Record<string, ExpressionRenderer<unknown>>'.
  Index signature is missing in type 'ExpressionRenderer<unknown>'.

 41     return this.toArray().reduce(
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 42       (acc, renderer) => ({
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
... 
 46       {} as Record<string, ExpressionRenderer>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 47     );
    ~~~~~~

src/plugins/expressions/common/expression_renderers/expression_renderer_registry.ts:42:26 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(callbackfn: (previousValue: ExpressionRenderer<unknown>, currentValue: ExpressionRenderer<unknown>, currentIndex: number, array: ExpressionRenderer<unknown>[]) => ExpressionRenderer<...>, initialValue: ExpressionRenderer<...>): ExpressionRenderer<...>', gave the following error.
    Type '{ [x: string]: ExpressionRenderer<unknown> | undefined; }' is missing the following properties from type 'ExpressionRenderer<unknown>': name, displayName, help, validate, and 2 more.
  Overload 2 of 3, '(callbackfn: (previousValue: Record<string, ExpressionRenderer<unknown>>, currentValue: ExpressionRenderer<unknown>, currentIndex: number, array: ExpressionRenderer<unknown>[]) => Record<...>, initialValue: Record<...>): Record<...>', gave the following error.
    Type '{ [x: string]: ExpressionRenderer<unknown> | undefined; }' is not assignable to type 'Record<string, ExpressionRenderer<unknown>>'.
      Index signatures are incompatible.
        Type 'ExpressionRenderer<unknown> | undefined' is not assignable to type 'ExpressionRenderer<unknown>'.
          Type 'undefined' is not assignable to type 'ExpressionRenderer<unknown>'.

42       (acc, renderer) => ({
                            ~~
43         ...acc,
   ~~~~~~~~~~~~~~~
44         [renderer.name]: renderer,
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45       }),
   ~~~~~~~~

  node_modules/typescript/lib/lib.es5.d.ts:1368:24
    1368     reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.
  node_modules/typescript/lib/lib.es5.d.ts:1374:27
    1374     reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.

src/core/server/saved_objects/migrations/core/document_migrator.ts:209:3 - error TS2322: Type 'SavedObjectsType' is not assignable to type 'ActiveMigrations'.

209   return typeRegistry
      ~~~~~~~~~~~~~~~~~~~
210     .getAllTypes()
    ~~~~~~~~~~~~~~~~~~
... 
225       };
    ~~~~~~~~
226     }, {} as ActiveMigrations);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/core/server/saved_objects/migrations/core/document_migrator.ts:212:13 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(callbackfn: (previousValue: SavedObjectsType, currentValue: SavedObjectsType, currentIndex: number, array: SavedObjectsType[]) => SavedObjectsType, initialValue: SavedObjectsType): SavedObjectsType', gave the following error.
    Argument of type '(migrations: ActiveMigrations, type: SavedObjectsType) => { [x: string]: { latestVersion: string; transforms: { version: string; transform: TransformFn; }[]; } | undefined; }' is not assignable to parameter of type '(previousValue: SavedObjectsType, currentValue: SavedObjectsType, currentIndex: number, array: SavedObjectsType[]) => SavedObjectsType'.
      Types of parameters 'migrations' and 'previousValue' are incompatible.
        Type 'SavedObjectsType' is not assignable to type 'ActiveMigrations'.
          Index signature is missing in type 'SavedObjectsType'.
  Overload 2 of 3, '(callbackfn: (previousValue: ActiveMigrations, currentValue: SavedObjectsType, currentIndex: number, array: SavedObjectsType[]) => ActiveMigrations, initialValue: ActiveMigrations): ActiveMigrations', gave the following error.
    Argument of type '(migrations: ActiveMigrations, type: SavedObjectsType) => { [x: string]: { latestVersion: string; transforms: { version: string; transform: TransformFn; }[]; } | undefined; }' is not assignable to parameter of type '(previousValue: ActiveMigrations, currentValue: SavedObjectsType, currentIndex: number, array: SavedObjectsType[]) => ActiveMigrations'.
      Type '{ [x: string]: { latestVersion: string; transforms: { version: string; transform: TransformFn; }[]; } | undefined; }' is not assignable to type 'ActiveMigrations'.
        Index signatures are incompatible.
          Type '{ latestVersion: string; transforms: { version: string; transform: TransformFn; }[]; } | undefined' is not assignable to type '{ latestVersion: string; transforms: { version: string; transform: TransformFn; }[]; }'.
            Type 'undefined' is not assignable to type '{ latestVersion: string; transforms: { version: string; transform: TransformFn; }[]; }'.

212     .reduce((migrations, type) => {
                ~~~~~~~~~~~~~~~~~~~~~~~


src/core/server/saved_objects/migrations/core/document_migrator.ts:375:5 - error TS2322: Type '{ [x: string]: string | undefined; }' is not assignable to type 'SavedObjectsMigrationVersion'.
  Index signatures are incompatible.
    Type 'string | undefined' is not assignable to type 'string'.
      Type 'undefined' is not assignable to type 'string'.

375     migrationVersion = updateMigrationVersion(doc, migrationVersion, prop, version);
        ~~~~~~~~~~~~~~~~

src/core/server/saved_objects/utils.ts:81:3 - error TS2322: Type 'SavedObjectsType' is not assignable to type 'SavedObjectsSchemaDefinition'.

 81   return types.reduce((schema, type) => {
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 82     return {
    ~~~~~~~~~~~~
... 
 91     };
    ~~~~~~
 92   }, {} as SavedObjectsSchemaDefinition);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/core/server/saved_objects/utils.ts:81:23 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(callbackfn: (previousValue: SavedObjectsType, currentValue: SavedObjectsType, currentIndex: number, array: SavedObjectsType[]) => SavedObjectsType, initialValue: SavedObjectsType): SavedObjectsType', gave the following error.
    Argument of type '(schema: SavedObjectsSchemaDefinition, type: SavedObjectsType) => { [x: string]: SavedObjectsSchemaTypeDefinition | undefined; }' is not assignable to parameter of type '(previousValue: SavedObjectsType, currentValue: SavedObjectsType, currentIndex: number, array: SavedObjectsType[]) => SavedObjectsType'.
      Types of parameters 'schema' and 'previousValue' are incompatible.
        Type 'SavedObjectsType' is not assignable to type 'SavedObjectsSchemaDefinition'.
          Index signature is missing in type 'SavedObjectsType'.
  Overload 2 of 3, '(callbackfn: (previousValue: SavedObjectsSchemaDefinition, currentValue: SavedObjectsType, currentIndex: number, array: SavedObjectsType[]) => SavedObjectsSchemaDefinition, initialValue: SavedObjectsSchemaDefinition): SavedObjectsSchemaDefinition', gave the following error.
    Argument of type '(schema: SavedObjectsSchemaDefinition, type: SavedObjectsType) => { [x: string]: SavedObjectsSchemaTypeDefinition | undefined; }' is not assignable to parameter of type '(previousValue: SavedObjectsSchemaDefinition, currentValue: SavedObjectsType, currentIndex: number, array: SavedObjectsType[]) => SavedObjectsSchemaDefinition'.
      Type '{ [x: string]: SavedObjectsSchemaTypeDefinition | undefined; }' is not assignable to type 'SavedObjectsSchemaDefinition'.
        Index signatures are incompatible.
          Type 'SavedObjectsSchemaTypeDefinition | undefined' is not assignable to type 'SavedObjectsSchemaTypeDefinition'.
            Type 'undefined' is not assignable to type 'SavedObjectsSchemaTypeDefinition'.

81   return types.reduce((schema, type) => {
                         ~~~~~~~~~~~~~~~~~~~


src/core/server/saved_objects/utils.ts:98:3 - error TS2322: Type '[string, SavedObjectLegacyMigrationFn]' is not assignable to type 'SavedObjectMigrationMap'.

 98   return Object.entries(legacyMigrations).reduce((migrated, [version, migrationFn]) => {
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 99     return {
    ~~~~~~~~~~~~
... 
102     };
    ~~~~~~
103   }, {} as SavedObjectMigrationMap);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/core/server/saved_objects/utils.ts:98:50 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(callbackfn: (previousValue: [string, SavedObjectLegacyMigrationFn], currentValue: [string, SavedObjectLegacyMigrationFn], currentIndex: number, array: [...][]) => [...], initialValue: [...]): [...]', gave the following error.
    Argument of type '(migrated: SavedObjectMigrationMap, [version, migrationFn]: [string, SavedObjectLegacyMigrationFn]) => { [x: string]: SavedObjectMigrationFn<any, any> | undefined; }' is not assignable to parameter of type '(previousValue: [string, SavedObjectLegacyMigrationFn], currentValue: [string, SavedObjectLegacyMigrationFn], currentIndex: number, array: [...][]) => [...]'.
      Types of parameters 'migrated' and 'previousValue' are incompatible.
        Type '[string, SavedObjectLegacyMigrationFn]' is not assignable to type 'SavedObjectMigrationMap'.
          Index signature is missing in type '[string, SavedObjectLegacyMigrationFn]'.
  Overload 2 of 3, '(callbackfn: (previousValue: SavedObjectMigrationMap, currentValue: [string, SavedObjectLegacyMigrationFn], currentIndex: number, array: [...][]) => SavedObjectMigrationMap, initialValue: SavedObjectMigrationMap): SavedObjectMigrationMap', gave the following error.
    Argument of type '(migrated: SavedObjectMigrationMap, [version, migrationFn]: [string, SavedObjectLegacyMigrationFn]) => { [x: string]: SavedObjectMigrationFn<any, any> | undefined; }' is not assignable to parameter of type '(previousValue: SavedObjectMigrationMap, currentValue: [string, SavedObjectLegacyMigrationFn], currentIndex: number, array: [...][]) => SavedObjectMigrationMap'.
      Type '{ [x: string]: SavedObjectMigrationFn<any, any> | undefined; }' is not assignable to type 'SavedObjectMigrationMap'.
        Index signatures are incompatible.
          Type 'SavedObjectMigrationFn<any, any> | undefined' is not assignable to type 'SavedObjectMigrationFn<any, any>'.
            Type 'undefined' is not assignable to type 'SavedObjectMigrationFn<any, any>'.

98   return Object.entries(legacyMigrations).reduce((migrated, [version, migrationFn]) => {
                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


src/plugins/share/public/components/url_panel_content.tsx:451:21 - error TS2345: Argument of type '{ urlParams: { [x: string]: { [queryParam: string]: boolean; } | undefined; }; }' is not assignable to parameter of type 'State | ((prevState: Readonly<State>, props: Readonly<Props>) => State | Pick<State, "urlParams"> | null) | Pick<...> | null'.
  Type '{ urlParams: { [x: string]: { [queryParam: string]: boolean; } | undefined; }; }' is not assignable to type 'Pick<State, "urlParams">'.
    Types of property 'urlParams' are incompatible.
      Type '{ [x: string]: { [queryParam: string]: boolean; } | undefined; }' is not assignable to type 'UrlParams'.
        Index signatures are incompatible.
          Type '{ [queryParam: string]: boolean; } | undefined' is not assignable to type '{ [queryParam: string]: boolean; }'.
            Type 'undefined' is not assignable to type '{ [queryParam: string]: boolean; }'.

451       this.setState(stateUpdate, this.state.useShortUrl ? this.createShortUrl : this.setUrl);
                        ~~~~~~~~~~~

src/plugins/share/public/components/share_context_menu.tsx:158:20 - error TS2790: The operand of a 'delete' operator must be optional.

158             delete menuItem.sortOrder;
                       ~~~~~~~~~~~~~~~~~~

src/plugins/vis_default_editor/public/components/agg_group_state.tsx:47:7 - error TS2322: Type '{ [x: string]: AggsItem | undefined; }' is not assignable to type 'AggsState'.
  Index signatures are incompatible.
    Type 'AggsItem | undefined' is not assignable to type 'AggsItem'.
      Type 'undefined' is not assignable to type 'AggsItem'.

47       return { ...state, [action.aggId]: { ...aggState, touched: action.payload } };
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/vis_default_editor/public/components/agg_group_state.tsx:49:7 - error TS2322: Type '{ [x: string]: AggsItem | undefined; }' is not assignable to type 'AggsState'.
  Index signatures are incompatible.
    Type 'AggsItem | undefined' is not assignable to type 'AggsItem'.
      Type 'undefined' is not assignable to type 'AggsItem'.

49       return { ...state, [action.aggId]: { ...aggState, valid: action.payload } };
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/vis_default_editor/public/components/controls/components/input_list.tsx:119:9 - error TS2345: Argument of type '{ [x: string]: InputItem | undefined; id: string; }[]' is not assignable to parameter of type 'InputModel[]'.
  Type '{ [x: string]: InputItem | undefined; id: string; }' is not assignable to type 'InputModel'.
    Type '{ [x: string]: InputItem | undefined; id: string; }' is not assignable to type 'InputItemModel'.
      Index signatures are incompatible.
        Type 'InputItem | undefined' is not assignable to type 'InputItem'.
          Type 'undefined' is not assignable to type 'InputItem'.

119         models.map((range, arrayIndex) =>
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120           arrayIndex === index
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... 
129             : range
    ~~~~~~~~~~~~~~~~~~~
130         )
    ~~~~~~~~~

src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx:157:7 - error TS2322: Type '{ [x: string]: DashboardPanelState<EmbeddableInput & { [k: string]: unknown; }> | undefined; }' is not assignable to type '{ [panelId: string]: DashboardPanelState<EmbeddableInput & { [k: string]: unknown; }>; }'.
  Index signatures are incompatible.
    Type 'DashboardPanelState<EmbeddableInput & { [k: string]: unknown; }> | undefined' is not assignable to type 'DashboardPanelState<EmbeddableInput & { [k: string]: unknown; }>'.
      Type 'undefined' is not assignable to type 'DashboardPanelState<EmbeddableInput & { [k: string]: unknown; }>'.

157       panels: {
          ~~~~~~

  src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx:63:3
    63   panels: {
         ~~~~~~
    The expected type comes from property 'panels' which is declared here on type 'Partial<DashboardContainerInput>'

src/plugins/saved_objects_management/public/management_section/object_view/components/form.tsx:135:7 - error TS2322: Type '{ [x: string]: FieldState | undefined; }' is not assignable to type 'Record<string, FieldState>'.
  Index signatures are incompatible.
    Type 'FieldState | undefined' is not assignable to type 'FieldState'.
      Type 'undefined' is not assignable to type 'FieldState'.

135       fieldStates: {
          ~~~~~~~~~~~

src/plugins/dashboard/public/application/dashboard_app_controller.tsx:440:24 - error TS2790: The operand of a 'delete' operator must be optional.

440                 delete input.id;
                           ~~~~~~~~

src/plugins/dashboard/server/saved_objects/migrations_730.ts:65:12 - error TS2790: The operand of a 'delete' operator must be optional.

65     delete doc.attributes.uiStateJSON;
              ~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/kibana_usage_collection/server/collectors/ui_metric/telemetry_ui_metric_collector.ts:63:54 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(callbackfn: (previousValue: SavedObject<UIMetricsSavedObjects>, currentValue: SavedObject<UIMetricsSavedObjects>, currentIndex: number, array: SavedObject<...>[]) => SavedObject<...>, initialValue: SavedObject<...>): SavedObject<...>', gave the following error.
    Argument of type '(accum: Record<string, { key: string; value: number; }[]>, rawUiMetric: SavedObject<UIMetricsSavedObjects>) => { [x: string]: { key: string; value: number; }[] | undefined; }' is not assignable to parameter of type '(previousValue: SavedObject<UIMetricsSavedObjects>, currentValue: SavedObject<UIMetricsSavedObjects>, currentIndex: number, array: SavedObject<...>[]) => SavedObject<...>'.
      Types of parameters 'accum' and 'previousValue' are incompatible.
        Type 'SavedObject<UIMetricsSavedObjects>' is not assignable to type 'Record<string, { key: string; value: number; }[]>'.
          Index signature is missing in type 'SavedObject<UIMetricsSavedObjects>'.
  Overload 2 of 3, '(callbackfn: (previousValue: Record<string, { key: string; value: number; }[]>, currentValue: SavedObject<UIMetricsSavedObjects>, currentIndex: number, array: SavedObject<...>[]) => Record<...>, initialValue: Record<...>): Record<...>', gave the following error.
    Argument of type '(accum: Record<string, { key: string; value: number; }[]>, rawUiMetric: SavedObject<UIMetricsSavedObjects>) => { [x: string]: { key: string; value: number; }[] | undefined; }' is not assignable to parameter of type '(previousValue: Record<string, { key: string; value: number; }[]>, currentValue: SavedObject<UIMetricsSavedObjects>, currentIndex: number, array: SavedObject<...>[]) => Record<...>'.
      Type '{ [x: string]: { key: string; value: number; }[] | undefined; }' is not assignable to type 'Record<string, { key: string; value: number; }[]>'.
        Index signatures are incompatible.
          Type '{ key: string; value: number; }[] | undefined' is not assignable to type '{ key: string; value: number; }[]'.
            Type 'undefined' is not assignable to type '{ key: string; value: number; }[]'.

63       const uiMetricsByAppName = rawUiMetrics.reduce((accum, rawUiMetric) => {
                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~


src/plugins/kibana_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.ts:79:9 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(callbackfn: (previousValue: SavedObject<ApplicationUsageTotal>, currentValue: SavedObject<ApplicationUsageTotal>, currentIndex: number, array: SavedObject<...>[]) => SavedObject<...>, initialValue: SavedObject<...>): SavedObject<...>', gave the following error.
    Argument of type '(acc: ApplicationUsageTelemetryReport, { attributes: { appId, minutesOnScreen, numberOfClicks } }: SavedObject<ApplicationUsageTotal>) => { [x: string]: { clicks_total: number; ... 6 more ...; minutes_on_screen_90_days: number; } | undefined; }' is not assignable to parameter of type '(previousValue: SavedObject<ApplicationUsageTotal>, currentValue: SavedObject<ApplicationUsageTotal>, currentIndex: number, array: SavedObject<...>[]) => SavedObject<...>'.
      Types of parameters 'acc' and 'previousValue' are incompatible.
        Type 'SavedObject<ApplicationUsageTotal>' is not assignable to type 'ApplicationUsageTelemetryReport'.
          Index signature is missing in type 'SavedObject<ApplicationUsageTotal>'.
  Overload 2 of 3, '(callbackfn: (previousValue: ApplicationUsageTelemetryReport, currentValue: SavedObject<ApplicationUsageTotal>, currentIndex: number, array: SavedObject<...>[]) => ApplicationUsageTelemetryReport, initialValue: ApplicationUsageTelemetryReport): ApplicationUsageTelemetryReport', gave the following error.
    Argument of type '(acc: ApplicationUsageTelemetryReport, { attributes: { appId, minutesOnScreen, numberOfClicks } }: SavedObject<ApplicationUsageTotal>) => { [x: string]: { clicks_total: number; ... 6 more ...; minutes_on_screen_90_days: number; } | undefined; }' is not assignable to parameter of type '(previousValue: ApplicationUsageTelemetryReport, currentValue: SavedObject<ApplicationUsageTotal>, currentIndex: number, array: SavedObject<...>[]) => ApplicationUsageTelemetryReport'.
      Type '{ [x: string]: { clicks_total: number; clicks_7_days: number; clicks_30_days: number; clicks_90_days: number; minutes_on_screen_total: number; minutes_on_screen_7_days: number; minutes_on_screen_30_days: number; minutes_on_screen_90_days: number; } | undefined; }' is not assignable to type 'ApplicationUsageTelemetryReport'.
        Index signatures are incompatible.
          Type '{ clicks_total: number; clicks_7_days: number; clicks_30_days: number; clicks_90_days: number; minutes_on_screen_total: number; minutes_on_screen_7_days: number; minutes_on_screen_30_days: number; minutes_on_screen_90_days: number; } | undefined' is not assignable to type '{ clicks_total: number; clicks_7_days: number; clicks_30_days: number; clicks_90_days: number; minutes_on_screen_total: number; minutes_on_screen_7_days: number; minutes_on_screen_30_days: number; minutes_on_screen_90_days: number; }'.
            Type 'undefined' is not assignable to type '{ clicks_total: number; clicks_7_days: number; clicks_30_days: number; clicks_90_days: number; minutes_on_screen_total: number; minutes_on_screen_7_days: number; minutes_on_screen_30_days: number; minutes_on_screen_90_days: number; }'.

79         (acc, { attributes: { appId, minutesOnScreen, numberOfClicks } }) => {
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


src/plugins/kibana_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.ts:103:28 - error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'SavedObject<ApplicationUsageTotal>'.
  No index signature with a parameter of type 'string' was found on type 'SavedObject<ApplicationUsageTotal>'.

103           const existing = acc[appId] || {
                               ~~~~~~~~~~

src/plugins/kibana_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.ts:172:7 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(callbackfn: (previousValue: SavedObject<ApplicationUsageTotal>, currentValue: SavedObject<ApplicationUsageTotal>, currentIndex: number, array: SavedObject<...>[]) => SavedObject<...>, initialValue: SavedObject<...>): SavedObject<...>', gave the following error.
    Argument of type '(acc: Record<string, { appId: string; minutesOnScreen: number; numberOfClicks: number; }>, { attributes: { appId, numberOfClicks, minutesOnScreen } }: SavedObject<ApplicationUsageTotal>) => { ...; }' is not assignable to parameter of type '(previousValue: SavedObject<ApplicationUsageTotal>, currentValue: SavedObject<ApplicationUsageTotal>, currentIndex: number, array: SavedObject<...>[]) => SavedObject<...>'.
      Types of parameters 'acc' and 'previousValue' are incompatible.
        Type 'SavedObject<ApplicationUsageTotal>' is not assignable to type 'Record<string, { appId: string; minutesOnScreen: number; numberOfClicks: number; }>'.
          Index signature is missing in type 'SavedObject<ApplicationUsageTotal>'.
  Overload 2 of 3, '(callbackfn: (previousValue: Record<string, { appId: string; minutesOnScreen: number; numberOfClicks: number; }>, currentValue: SavedObject<ApplicationUsageTotal>, currentIndex: number, array: SavedObject<...>[]) => Record<...>, initialValue: Record<...>): Record<...>', gave the following error.
    Argument of type '(acc: Record<string, { appId: string; minutesOnScreen: number; numberOfClicks: number; }>, { attributes: { appId, numberOfClicks, minutesOnScreen } }: SavedObject<ApplicationUsageTotal>) => { ...; }' is not assignable to parameter of type '(previousValue: Record<string, { appId: string; minutesOnScreen: number; numberOfClicks: number; }>, currentValue: SavedObject<ApplicationUsageTotal>, currentIndex: number, array: SavedObject<...>[]) => Record<...>'.
      Type '{ [x: string]: { appId: string; minutesOnScreen: number; numberOfClicks: number; } | undefined; }' is not assignable to type 'Record<string, { appId: string; minutesOnScreen: number; numberOfClicks: number; }>'.
        Index signatures are incompatible.
          Type '{ appId: string; minutesOnScreen: number; numberOfClicks: number; } | undefined' is not assignable to type '{ appId: string; minutesOnScreen: number; numberOfClicks: number; }'.
            Type 'undefined' is not assignable to type '{ appId: string; minutesOnScreen: number; numberOfClicks: number; }'.

172       (acc, { attributes: { appId, numberOfClicks, minutesOnScreen } }) => {
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


src/plugins/kibana_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.ts:185:24 - error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'SavedObject<ApplicationUsageTotal>'.
  No index signature with a parameter of type 'string' was found on type 'SavedObject<ApplicationUsageTotal>'.

185       const existing = acc[appId] || { minutesOnScreen: 0, numberOfClicks: 0 };
                           ~~~~~~~~~~

src/plugins/kibana_usage_collection/server/collectors/kibana/get_saved_object_counts.ts:78:3 - error TS2322: Type '{ key: string; doc_count: number; }' is not assignable to type 'KibanaSavedObjectCounts'.
  Property 'key' is incompatible with index signature.
    Type 'string' is not assignable to type '{ total: number; }'.

78   return buckets.reduce(
     ~~~~~~~~~~~~~~~~~~~~~~
79     (acc, { key, doc_count: total }) => (total ? { ...acc, [snakeCase(key)]: { total } } : acc),
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
80     allZeros
   ~~~~~~~~~~~~
81   );
   ~~~~

src/plugins/kibana_usage_collection/server/collectors/kibana/get_saved_object_counts.ts:79:41 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(callbackfn: (previousValue: { key: string; doc_count: number; }, currentValue: { key: string; doc_count: number; }, currentIndex: number, array: { key: string; doc_count: number; }[]) => { key: string; doc_count: number; }, initialValue: { ...; }): { ...; }', gave the following error.
    Type '{ [x: string]: { total: number; } | undefined; }' is missing the following properties from type '{ key: string; doc_count: number; }': key, doc_count
  Overload 2 of 3, '(callbackfn: (previousValue: KibanaSavedObjectCounts, currentValue: { key: string; doc_count: number; }, currentIndex: number, array: { key: string; doc_count: number; }[]) => KibanaSavedObjectCounts, initialValue: KibanaSavedObjectCounts): KibanaSavedObjectCounts', gave the following error.
    Type '{ [x: string]: { total: number; } | undefined; }' is not assignable to type 'KibanaSavedObjectCounts'.
      Index signatures are incompatible.
        Type '{ total: number; } | undefined' is not assignable to type '{ total: number; }'.
          Type 'undefined' is not assignable to type '{ total: number; }'.

79     (acc, { key, doc_count: total }) => (total ? { ...acc, [snakeCase(key)]: { total } } : acc),
                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.es5.d.ts:1368:24
    1368     reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.
  node_modules/typescript/lib/lib.es5.d.ts:1374:27
    1374     reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from the return type of this signature.

src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts:46:12 - error TS2790: The operand of a 'delete' operator must be optional.

46     delete metrics.process.pid;
              ~~~~~~~~~~~~~~~~~~~

src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts:51:12 - error TS2790: The operand of a 'delete' operator must be optional.

51     delete metrics.requests.statusCodes;
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/plugins/vis_type_vislib/public/components/common/validation_wrapper.tsx:45:19 - error TS2345: Argument of type '(state: { [key: string]: Item; }) => { [x: string]: Item | undefined; }' is not assignable to parameter of type 'SetStateAction<{ [key: string]: Item; }>'.
  Type '(state: { [key: string]: Item; }) => { [x: string]: Item | undefined; }' is not assignable to type '(prevState: { [key: string]: Item; }) => { [key: string]: Item; }'.
    Type '{ [x: string]: Item | undefined; }' is not assignable to type '{ [key: string]: Item; }'.
      Index signatures are incompatible.
        Type 'Item | undefined' is not assignable to type 'Item'.
          Type 'undefined' is not assignable to type 'Item'.

 45     setPanelState((state) => ({
                      ~~~~~~~~~~~~~
 46       ...state,
    ~~~~~~~~~~~~~~~
... 
 49       },
    ~~~~~~~~
 50     }));
    ~~~~~~

src/plugins/vis_type_vislib/public/vislib/helpers/point_series/point_series.ts:116:10 - error TS2790: The operand of a 'delete' operator must be optional.

116   delete chart.aspects;
             ~~~~~~~~~~~~~


Found 34 errors.

@kibanamachine
Copy link
Contributor

@mshustov mshustov mentioned this pull request Jul 31, 2020
@joshdover joshdover mentioned this pull request Aug 14, 2020
12 tasks
@jinmu03 jinmu03 changed the title Ts 4 project references Ts 4 project references and incremental builds Aug 14, 2020
@mshustov mshustov closed this Sep 12, 2020
@rudolf rudolf deleted the ts-4-project-references branch May 16, 2022 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants