thalesog / pix-utils

Set of tools to parse, generate and validate payments of Brazil Instant Payment System (Pix) in Javascript
MIT License
65 stars 15 forks source link

interface desatualizada #23

Closed coelho-faminto closed 2 months ago

coelho-faminto commented 1 year ago

https://github.com/thalesog/pix-utils/blob/6279dd0576cce146c7216ac3f7ff0c24d2a76bed/src/types/pixFunctions.ts#L14

esta interface nao deve ser usada como esta, o correto seria utilizar o codigo importado de dynamicPayload =>

// PIXFetchParams adicionado na linha abaixo
import { PIXFetchResults, PIXFetchParams } from '../dynamicPayload';
import { PixDynamicObject, PixStaticObject } from './pixElements';
import { PixError } from './pixError';
export interface PixFnDefault {
    readonly toBRCode: () => string;
    readonly toImage: () => Promise<string>;
}
export interface PixStaticFn extends PixFnDefault {
    readonly throwIfError: () => PixStaticObject;
}

export interface PixDynamicFn extends PixFnDefault {
    // trocado abaixo por PIXFetchParams
    readonly fetchPayload: (params: PIXFetchParams) => Promise<PIXFetchResults | PixError>;
    readonly throwIfError: () => PixDynamicObject;
}
export {};
thalesog commented 2 months ago

@coelho-faminto sinta-se a vontade para encaminhar um PR com sugestões, obrigado.