import { ShopifyObjectType } from '../models';
export declare type Nullable<T> = T | null;
/**
 * Generic type for whenever you need an object containing all Shopify entities.
 *
 * I want somethign like this but it's not possible atm :(
 * https://github.com/Microsoft/TypeScript/issues/1213
 *
 * type Record<K extends keyof any, T extends any<"generic">> = {
 *   [P in K]: T<P>;
 * };
 */
export declare type MappedShopifyObjectType<T extends unknown> = Record<ShopifyObjectType, T>;
export declare type ReadonlyPropNames<T> = Readonly<(keyof T)[]>;
export declare type Writable<T> = {
    -readonly [K in keyof T]: T[K];
};
declare type Primitive = string | Function | number | boolean | Symbol | undefined | null;
declare type DeepOmitArray<T extends any[], K> = {
    [P in keyof T]: DeepOmit<T[P], K>;
};
export declare type DeepOmit<T, K> = T extends Primitive ? T : {
    [P in Exclude<keyof T, K>]: T[P] extends infer TP ? TP extends Primitive ? TP : TP extends any[] ? DeepOmitArray<TP, K> : DeepOmit<TP, K> : never;
};
export declare type NonNullableObject<T> = {
    [K in keyof T]: NonNullable<T[K]>;
};
export declare type NullableObject<T> = {
    [K in keyof T]: Nullable<T[K]>;
};
export declare type ValueOf<T> = T[keyof T];
export declare class UnreachableCaseError extends Error {
    constructor(val: never);
}
export declare type Complete<T> = {
    [P in keyof Required<T>]: Pick<T, P> extends Required<Pick<T, P>> ? T[P] : (T[P] | undefined);
};
/**
 * Source: https://stackoverflow.com/a/48244432/4744177
 */
export declare type AtLeastOne<T, U = {
    [K in keyof T]: Pick<T, K>;
}> = Partial<T> & U[keyof U];
export declare type MaybePromise<T> = Promise<T> | T;
export declare type DeepPartial<T> = T extends Function ? T : (T extends object ? {
    [P in keyof T]?: DeepPartial<T[P]>;
} : T);
export declare type WithRequired<T, K extends keyof T> = T & Required<Pick<T, K>>;
/**
 * Taken from https://github.com/Microsoft/TypeScript/issues/28046#issuecomment-480516434
 */
export declare type ElementType<T extends ReadonlyArray<unknown>> = T extends ReadonlyArray<infer ElementType> ? ElementType : never;
export declare type NonFunctionKeys<T> = {
    [Key in keyof T]-?: T[Key] extends Function ? never : Key;
}[keyof T];
export declare type NonNullableKeys<T> = {
    [P in keyof T]-?: null extends T[P] ? never : P;
}[keyof T];
export declare type PickNonNullable<T> = Pick<T, NonNullableKeys<T>>;
/**
* Great breakdown of how this works here:
* https://mariusschulz.com/blog/conditional-types-in-typescript
*/
export declare type NonNilKeys<T> = {
    [P in keyof T]-?: null extends T[P] ? never : undefined extends T[P] ? never : P;
}[keyof T];
export declare type PickNonNillable<T> = Pick<T, NonNilKeys<T>>;
export declare type PickNillable<T> = Omit<T, NonNilKeys<T>>;
export declare type PartialNullableObject<T, NullableKey extends keyof T> = {
    [P in keyof T]: P extends NullableKey ? T[P] | null : T[P];
};
export declare type RequiredKeys<T> = {
    [P in keyof T]-?: undefined extends T[P] ? never : P;
}[keyof T];
export declare type OptionalKeys<T> = {
    [P in keyof T]-?: undefined extends T[P] ? P : never;
}[keyof T];
export declare type PickNonOptionalProperties<T> = Pick<T, RequiredKeys<T>>;
export declare type PickOptionalProperties<T> = Omit<T, RequiredKeys<T>>;
export declare type MappedNonNullable<T> = {
    [P in keyof T]: NonNullable<T[P]>;
};
export declare type Nil = undefined | null;
export declare type NullIfUndefined<T> = undefined extends T ? Exclude<T, undefined> | null : T;
export declare type Nillable<T> = T | null | undefined;
export declare type MappedNullIfUndefined<T> = {
    [P in keyof T]: NullIfUndefined<T[P]>;
};
/**
* Source: https://github.com/microsoft/TypeScript/issues/3496#issuecomment-128553540
*/
export declare type JSONValue = string | number | boolean | JSONObject | JSONArray;
export interface JSONObject {
    [x: string]: JSONValue;
}
export interface JSONArray extends Array<JSONValue> {
}
export declare type PromiseResolveType<T> = T extends PromiseLike<infer U> ? U : T;
export declare type ResolvedObject<T> = PromiseResolveType<{
    [P in keyof T]: PromiseResolveType<T[P]>;
}>;
export {};
