From b647038214eb4042c5c5953c400e4fc4c3363340 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Fri, 31 May 2024 17:47:26 +0200 Subject: [PATCH] Fix typing for format2 schema imports --- .../src/schema/versions.ts | 18 ++++++++++-------- server/gx-workflow-ls-format2/src/types.d.ts | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/server/gx-workflow-ls-format2/src/schema/versions.ts b/server/gx-workflow-ls-format2/src/schema/versions.ts index 06736f2..38f6385 100644 --- a/server/gx-workflow-ls-format2/src/schema/versions.ts +++ b/server/gx-workflow-ls-format2/src/schema/versions.ts @@ -1,7 +1,7 @@ -import schema_v19_09_workflows from "@schemas/gxformat2/v19_09/workflows.yaml"; +import schema_common from "@schemas/gxformat2/common/common.yaml"; import schema_common_metaschema_base from "@schemas/gxformat2/common/metaschema/metaschema_base.yaml"; import schema_v19_09_process from "@schemas/gxformat2/v19_09/process.yaml"; -import schema_common from "@schemas/gxformat2/common/common.yaml"; +import schema_v19_09_workflows from "@schemas/gxformat2/v19_09/workflows.yaml"; import { SchemaDocument } from "./definitions"; /** @@ -9,9 +9,11 @@ import { SchemaDocument } from "./definitions"; * * These documents are raw yaml documents loaded by webpack. * */ -export const SCHEMA_DOCS_v19_09_MAP = new Map([ - [schema_common_metaschema_base.$base, schema_common_metaschema_base], - [schema_v19_09_process.$base, schema_v19_09_process], - [schema_common.$base, schema_common], - [schema_v19_09_workflows.$base, schema_v19_09_workflows], -]); +export const SCHEMA_DOCS_v19_09_MAP = new Map( + [ + schema_common_metaschema_base as SchemaDocument, + schema_v19_09_process as SchemaDocument, + schema_common as SchemaDocument, + schema_v19_09_workflows as SchemaDocument, + ].map((schemaDoc) => [schemaDoc.$base, schemaDoc]) +); diff --git a/server/gx-workflow-ls-format2/src/types.d.ts b/server/gx-workflow-ls-format2/src/types.d.ts index 6383136..15ef5f3 100644 --- a/server/gx-workflow-ls-format2/src/types.d.ts +++ b/server/gx-workflow-ls-format2/src/types.d.ts @@ -1,4 +1,4 @@ declare module "*.yaml" { - const data: any; + const data: unknown; export default data; }