Using `declaration: true` with Returned Objects Containing Tag Classes in TypeScript
What can I do if I want to use
If I try to compile this with
How can I fix this?
declaration: truedeclaration: true and I return objects that have a tag class in them such as:export const fun = () => {
class Tag extends Context.Tag("some-tag")<
Tag,
{
foo: () => void;
}
>() {}
return {
Tag
}
};export const fun = () => {
class Tag extends Context.Tag("some-tag")<
Tag,
{
foo: () => void;
}
>() {}
return {
Tag
}
};If I try to compile this with
declaration: truedeclaration: true I get:The inferred type of 'fun' references an inaccessible 'unique symbol' type. A type annotation is necessary.ts(2527)
Exported variable 'fun' has or is using name 'ChannelTypeId' from external module "/my-dir/node_modules/.pnpm/effect@2.4.7/node_modules/effect/dist/dts/Channel" but cannot be named.ts(4023)
Exported variable 'fun' has or is using name 'EffectTypeId' from external module "/my-dir/node_modules/.pnpm/effect@2.4.7/node_modules/effect/dist/dts/Effect" but cannot be named.ts(4023)
Exported variable 'fun' has or is using name 'NodeInspectSymbol' from external module "/my-dir/node_modules/.pnpm/effect@2.4.7/node_modules/effect/dist/dts/Inspectable" but cannot be named.ts(4023)
Exported variable 'fun' has or is using name 'STMTypeId' from external module "/my-dir/node_modules/.pnpm/effect@2.4.7/node_modules/effect/dist/dts/STM" but cannot be named.ts(4023
Exported variable 'fun' has or is using name 'SinkTypeId' from external module "/my-dir/node_modules/.pnpm/effect@2.4.7/node_modules/effect/dist/dts/Sink" but cannot be named.ts(4023)
Exported variable 'fun' has or is using name 'StreamTypeId' from external module "/my-dir/node_modules/.pnpm/effect@2.4.7/node_modules/effect/dist/dts/Stream" but cannot be named.ts(4023)
Exported variable 'fun' has or is using name 'TagTypeId' from external module "/my-dir/node_modules/.pnpm/effect@2.4.7/node_modules/effect/dist/dts/Context" but cannot be named.ts(4023)
Exported variable 'fun' has or is using name 'Unify' from external module "/my-dir/node_modules/.pnpm/effect@2.4.7/node_modules/effect/dist/dts/Context" but cannot be named.ts(4023)The inferred type of 'fun' references an inaccessible 'unique symbol' type. A type annotation is necessary.ts(2527)
Exported variable 'fun' has or is using name 'ChannelTypeId' from external module "/my-dir/node_modules/.pnpm/effect@2.4.7/node_modules/effect/dist/dts/Channel" but cannot be named.ts(4023)
Exported variable 'fun' has or is using name 'EffectTypeId' from external module "/my-dir/node_modules/.pnpm/effect@2.4.7/node_modules/effect/dist/dts/Effect" but cannot be named.ts(4023)
Exported variable 'fun' has or is using name 'NodeInspectSymbol' from external module "/my-dir/node_modules/.pnpm/effect@2.4.7/node_modules/effect/dist/dts/Inspectable" but cannot be named.ts(4023)
Exported variable 'fun' has or is using name 'STMTypeId' from external module "/my-dir/node_modules/.pnpm/effect@2.4.7/node_modules/effect/dist/dts/STM" but cannot be named.ts(4023
Exported variable 'fun' has or is using name 'SinkTypeId' from external module "/my-dir/node_modules/.pnpm/effect@2.4.7/node_modules/effect/dist/dts/Sink" but cannot be named.ts(4023)
Exported variable 'fun' has or is using name 'StreamTypeId' from external module "/my-dir/node_modules/.pnpm/effect@2.4.7/node_modules/effect/dist/dts/Stream" but cannot be named.ts(4023)
Exported variable 'fun' has or is using name 'TagTypeId' from external module "/my-dir/node_modules/.pnpm/effect@2.4.7/node_modules/effect/dist/dts/Context" but cannot be named.ts(4023)
Exported variable 'fun' has or is using name 'Unify' from external module "/my-dir/node_modules/.pnpm/effect@2.4.7/node_modules/effect/dist/dts/Context" but cannot be named.ts(4023)How can I fix this?
