musicglue/joi-ts-generator

Undefined reference in generated library.ts

Opened this issue · 1 comments

xkr47 commented

In the generated library.ts (which isn't documented in the README btw) there is a code snippet like this:

export function coerceFactory<T>(
  factory: Factory.IFactory,
  schema: joi.Schema,
) {
...

but the referenced Factory is not declared or imported anywhere.. Should it come from the rosie package or is it something else?

xkr47 commented

Added this in a file called library-fix.d.ts in my project as a temporary workaround (I don't need the factory stuff):

declare namespace Factory {
  export interface IFactory {
    build: any;
  }
}