Open nimo-juice opened 2 years ago
Your type library does not cover most of the type definitions for the library itself. It would be great to add more.
Typescript definitions are failing in my repository.
import { IConfig } from '@vgs/collect-js/dist/utils/IConfig'; type stateParam = { errorMessages: string[]; isDirty: boolean; isEmpty: boolean; isFocused: boolean; isTouched: boolean; isValid: boolean; name: string; }; type responseData = { errors: { detail: string; source: { pointer: string; }; status: string; title: string; }[]; }; declare module '@vgs/collect-js' { export interface VGSForm { field: ( id: string, options: { type: string; name: string; placeholder: string; validations: string[]; successColor?: string; errorColor?: string; maxLength?: number; yearLength?: number; serializers?: string[]; css?: Record<string, string>; }, ) => void; SERIALIZERS: string; submit: ( path: string, options: { mapDotToObject: string; headers: Record<string, string>; }, onResponse?: (status: number, data: responseData) => void, ) => void; state: Record<string, stateParam>; onUpdateCallback: unknown; } export interface CollectFN { init: (fn?: (state: Record<string, stateParam>) => void) => VGSFormDef; } export const loadVGSCollect: (config?: IConfig) => Promise<CollectFN>; }
@nimo-juice thank you for pointing this out! We'll work on adding more types.
@AnnaKudriasheva happy to open a PR if there are recommendations on how : )
What is the status for it @AnnaKudriasheva ?
Expected Behavior
Your type library does not cover most of the type definitions for the library itself. It would be great to add more.
Current Behavior
Typescript definitions are failing in my repository.
Possible Solution
Context
Your Environment