Change withFeatureCheck() return value to also include PromiseLike<T> as an anticipation

This commit is contained in:
Faisal Salman 2024-10-29 21:24:16 +07:00
parent 9890f9f5f8
commit aad163ffc5
2 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ declare namespace UAParser {
is(val: string): boolean;
toString(): string;
withClientHints(): PromiseLike<T> | T;
withFeatureCheck(): T;
withFeatureCheck(): PromiseLike<T> | T;
}
interface IBrowser extends IData<IBrowser> {

View File

@ -32,8 +32,8 @@ expectType<'crawler' | 'cli' | 'email' | 'fetcher' | 'inapp' | 'mediaplayer' | '
expectType<boolean>(browser.is(''));
expectType<string>(browser.toString());
expectType<IBrowser | PromiseLike<IBrowser>>(browser.withClientHints());
expectType<IBrowser>((<IBrowser>browser.withClientHints()).withFeatureCheck());
expectType<boolean>((<IBrowser>browser.withClientHints()).withFeatureCheck().is(''));
expectType<IBrowser | PromiseLike<IBrowser>>((<IBrowser>browser.withClientHints()).withFeatureCheck());
expectType<boolean>((<IBrowser>(<IBrowser>browser.withClientHints()).withFeatureCheck()).is(''));
expectType<ICPU>(parser.getCPU());
expectType<IDevice>(parser.getDevice());