aniql 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -3,9 +3,9 @@ import type { ClientOptions, FieldsSelection } from './genql/runtime';
3
3
  /** Represents a value that can be awaited. */
4
4
  type Awaitable<T> = Promise<T> | T;
5
5
  /** A utility type to make an object type more readable by removing excess properties. */
6
- type Prettify<T> = {
7
- [K in keyof T]: T[K];
8
- } & {};
6
+ type Prettify<T> = T extends object ? {
7
+ [K in keyof T]: Prettify<T[K]>;
8
+ } & {} : T;
9
9
  /** Options for the AniQL client. */
10
10
  type AniQLOptions = ClientOptions & {
11
11
  get_token?: () => Awaitable<string | undefined>;
@@ -26,10 +26,10 @@ declare class AniQLClient {
26
26
  constructor(client_id: number, opts?: AniQLOptions);
27
27
  query<R extends QueryGenqlSelection>(request: R & {
28
28
  __name?: string;
29
- }): Promise<FieldsSelection<Query, R> extends infer T ? { [K in keyof T]: FieldsSelection<Query, R>[K]; } : never>;
29
+ }): Promise<Prettify<FieldsSelection<Query, R>>>;
30
30
  mutation<R extends MutationGenqlSelection>(request: R & {
31
31
  __name?: string;
32
- }): Promise<FieldsSelection<Mutation, R> extends infer T ? { [K in keyof T]: FieldsSelection<Mutation, R>[K]; } : never>;
32
+ }): Promise<Prettify<FieldsSelection<Mutation, R>>>;
33
33
  login_url(): string;
34
34
  }
35
35
  export * from './genql';