Skip to content

Commit

Permalink
docs: export some additional types for the script result
Browse files Browse the repository at this point in the history
  • Loading branch information
aniravi24 committed Sep 28, 2024
1 parent d4eb0d4 commit 0ff177f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/typefusion/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SkottNode } from "skott/graph/node";
import { dbInsert } from "./store.js";
import { PgLiveEffect } from "./db/postgres/client.js";
import { MySqlLiveEffect } from "./db/mysql/client.js";
import { TypefusionScriptExport } from "./types.js";
import { TypefusionScript } from "./types.js";

/**
* Traverses a dependency graph and returns an array of execution levels.
Expand Down Expand Up @@ -65,7 +65,7 @@ export function runTypefusionScript(leaf: string) {

const moduleDefault = yield* Effect.tryPromise({
try: async () =>
import(path).then((module) => module.default as TypefusionScriptExport),
import(path).then((module) => (module as TypefusionScript).default),
catch: (error) =>
new ModuleImportError({
cause: error,
Expand Down
7 changes: 6 additions & 1 deletion packages/typefusion/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export { typefusionRef, typefusionRefTableName } from "./lib.js";
export { UnsupportedJSTypeDbConversionError } from "./db/common/service.js";

export {
TypefusionDbResult as TypefusionDbResult,
TypefusionDbResult,
TypefusionResult,
TypefusionResultDataOnly,
TypefusionResultUnknown,
Expand All @@ -29,6 +29,11 @@ export * from "./db/postgres/types.js";

export * from "./db/mysql/types.js";

export {
TypefusionSupportedDatabases,
TypefusionScriptExport,
} from "./types.js";

export const typefusion = (config: TypefusionConfig) =>
typefusionEffect(config).pipe(Effect.runPromise);

Expand Down

0 comments on commit 0ff177f

Please sign in to comment.