From 1efd609f16b72cecfcb60bf74facbcc1f1204561 Mon Sep 17 00:00:00 2001 From: Prev Wong Date: Sat, 9 Mar 2024 12:41:16 +0800 Subject: [PATCH] chore: render type any in external component --- .changeset/poor-balloons-explode.md | 5 +++++ packages/types/src/generated/types.generated.ts | 7 ++++--- packages/types/src/types.definition.ts | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .changeset/poor-balloons-explode.md diff --git a/.changeset/poor-balloons-explode.md b/.changeset/poor-balloons-explode.md new file mode 100644 index 00000000..bf828a23 --- /dev/null +++ b/.changeset/poor-balloons-explode.md @@ -0,0 +1,5 @@ +--- +'@rekajs/types': patch +--- + +Use type any in external component render type diff --git a/packages/types/src/generated/types.generated.ts b/packages/types/src/generated/types.generated.ts index e0cbcbfc..48c17a11 100644 --- a/packages/types/src/generated/types.generated.ts +++ b/packages/types/src/generated/types.generated.ts @@ -1,6 +1,7 @@ -import { Type, TypeConstructorOptions } from '../node'; import { Schema } from '../schema'; +import { Type, TypeConstructorOptions } from '../node'; + type StateParameters = { program: Program; extensions?: Record; @@ -720,7 +721,7 @@ Schema.register('RekaComponent', RekaComponent); type ExternalComponentParameters = { meta?: Record; name: string; - render: Function; + render: any; props?: Array; }; @@ -729,7 +730,7 @@ export class ExternalComponent extends Component { // @ts-ignore private declare __isExternalComponent?: string; - declare render: Function; + declare render: any; declare props: Array; constructor( value: ExternalComponentParameters, diff --git a/packages/types/src/types.definition.ts b/packages/types/src/types.definition.ts index be206177..2bb959bd 100644 --- a/packages/types/src/types.definition.ts +++ b/packages/types/src/types.definition.ts @@ -262,7 +262,7 @@ Schema.define('RekaComponent', { Schema.define('ExternalComponent', { extends: 'Component', fields: (t) => ({ - render: t.type('Function'), + render: t.any, props: t.defaultValue(t.array(t.node('ComponentProp')), []), }), });