brave/adblock-rust

Wrong types for js bindings

darahe opened this issue · 2 comments

request_type

Current:

request_type: string

Expected:

request_type: RequestType // union type or enum

engine.check

Current:

check(url: string, source_url: string, request_type: string, debug?: boolean): boolean;

Expected:

check(url: string, source_url: string, request_type: string, debug?: boolean): boolean | DebugObject; // it returns object with debug info if debug is true

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/f5925b6c95f53653f35ce3f83fcda1ba9b1e04a6/types/adblock-rs/index.d.ts#L27C43-L27C65

interesting, I didn't realize there were 3rd-party type bindings for this repo. Probably the issue should be filed there instead?

I guess the ideal solution would be to migrate the types into this repo... I'm not a TS expert but I will investigate options.