baixingwenzheng-pc/node_modules/vooks/es/use-breakpoint.d.ts
2024-01-29 09:26:07 +08:00

12 lines
650 B
TypeScript

import { ComputedRef } from 'vue';
import { BreakpointOptions, ExtractBreakpoint, DefaultBreakpointOptions } from './use-breakpoints';
declare type HasZero<T> = {
[key in keyof T]: T[key] extends 0 ? true : T[key] extends '0' ? true : false;
};
declare type CanBeUndef<T> = HasZero<T> extends {
[key: string]: false;
} ? true : false;
declare function useBreakpoint(): ComputedRef<ExtractBreakpoint<DefaultBreakpointOptions>>;
declare function useBreakpoint<T extends BreakpointOptions>(screens: T): CanBeUndef<T> extends true ? ComputedRef<ExtractBreakpoint<T> | undefined> : ComputedRef<ExtractBreakpoint<T>>;
export default useBreakpoint;