Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect type reference in index.d.ts #32

Open
delaneyb opened this issue Jan 23, 2025 · 1 comment
Open

Incorrect type reference in index.d.ts #32

delaneyb opened this issue Jan 23, 2025 · 1 comment

Comments

@delaneyb
Copy link

delaneyb commented Jan 23, 2025

export interface MultiResult {
[k: Permissions | string]: Status;
}
export type Result<T> = T extends any[] ? MultipleResult : Status;
export type RequestOptions<T extends Permissions = Permissions> = T extends keyof ObjectPermissions ? ObjectPermissions[T] : any;
export function request<T extends Permissions>(permission: T, options?: RequestOptions<T>): Promise<Status>;
export function request<T extends Partial<ObjectPermissions | ObjectPermissionsRest>>(permission: T): Promise<MultiResult>;
export function request<T extends string>(permission: T): Promise<Status>;
export function checkMultiple<T extends Partial<ObjectPermissionsRest>>(permissions: T): Promise<MultiResult>;

There are various uses of Status in index.d.ts where it appears the intended type would be IStatus from

export type IStatus = 'authorized' | 'denied' | 'limited' | 'restricted' | 'undetermined' | 'never_ask_again';

This results in editor confusion as the identifier cannot be resolved to an actual type.

@farfromrefug
Copy link
Member

@delaneyb thanks i just released a new version which should fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants