bencebalogh / avro-schema-registry

Confluent Schema Registry implementation in javascript to easily serialize and deserialize kafka messages
MIT License
28 stars 30 forks source link

Typescript definitons don't export the function signatures #19

Closed dbevan-kabam closed 5 years ago

dbevan-kabam commented 5 years ago

Hey, I've got a branch with an updated d.ts and a typescript example in the .readme. Here is the change

declare namespace schema {
    export type DecodeMessage = <T>(obj: Buffer, parseOptions?: any) => Promise<T>;
    export type EncodeById = (schemaId: number, msg: any, parseOptions?: any) => Promise<Buffer>;
    export type EncodeBySchema = (topic: string, schema: any, msg: any, parseOptions?: any) => Promise<Buffer>;

    export interface ISchemaRegistry {
        decode: DecodeMessage;
        decodeMessage: DecodeMessage;
        encodeById: EncodeById;
        encodeKey: EncodeBySchema;
        encodeMessage: EncodeBySchema;
    }
}

export = schema;
declare function schema(registryUrl: string) : schema.ISchemaRegistry;

If you can give me repository access I'll submit a PR

katsanva commented 5 years ago

@dbevan-kabam you don't need repository access. Just submit the PR.

dbevan-kabam commented 5 years ago

I get a 403 when I try to push my branch

katsanva commented 5 years ago

Are you sure that you have set up your credentials correctly? Also check this https://help.github.com/en/articles/creating-a-pull-request-from-a-fork

bencebalogh commented 5 years ago

Sorry, been away again for a bit. Thanks @katsanva for helping out!

No special permisions are needed, if after reading that link you still have issues let us know and I'll try to help.

bencebalogh commented 5 years ago

Out in 1.4.2