@everwhen/temporal
Version:
_description_
45 lines (44 loc) • 4.04 kB
TypeScript
import { Temporal } from 'temporal-polyfill';
import { Duration } from './duration.ts';
import { Instant } from './instant.ts';
import { Interval, type IntervalLike } from './interval.ts';
import { PlainDateTime, type PlainDateTimeLike } from './plain-date-time.ts';
import { PlainDate, type PlainDateLike } from './plain-date.ts';
import { PlainTime, type PlainTimeLike } from './plain-time.ts';
import { PlainYearMonth, type PlainYearMonthLike } from './plain-year-month.ts';
import type { Point } from './point.ts';
import type { Class, TypeGuard, TypeGuardType } from './type-utils.ts';
import { ZonedDateTime, type ZonedDateTimeLike } from './zoned-date-time.ts';
export type { TypeGuard, TypeGuardType } from './type-utils.ts';
export declare const isString: (value: unknown) => value is string;
export declare const isObject: (value: unknown) => value is object;
export declare function isInstanceOf<T>(instance: unknown, class_: Class<T>): instance is T;
export declare function isDuration(value: unknown): value is Duration;
export declare function isInstant(value: unknown): value is Instant;
export declare function isPlainDate(value: unknown): value is PlainDate;
export declare function isPlainDateTime(value: unknown): value is PlainDateTime;
export declare function isPlainTime(value: unknown): value is PlainTime;
export declare function isPlainTimeLike(value: unknown): value is PlainTimeLike;
export declare function isTimeZoneLike(value: unknown): value is Temporal.TimeZoneLike;
export declare function isPlainDateTimeLike(value: unknown): value is PlainDateTimeLike;
export declare function isPlainDateLike(value: unknown): value is PlainDateLike;
export declare function isPlainYearMonthLike(value: unknown): value is PlainYearMonthLike;
export declare function isZonedDateTimeLike(value: unknown): value is ZonedDateTimeLike;
export declare function isPlainYearMonth(value: unknown): value is PlainYearMonth;
export declare function isZonedDateTime(value: unknown): value is ZonedDateTime;
export declare function isPoint<T extends Point>(value: unknown, typeGuard?: TypeGuard<T>): value is T;
export declare function isPointAny<Ts extends ((value: unknown) => value is Point)[]>(value: unknown, typeGuards: [...Ts]): value is TypeGuardType<Ts[number]>;
export declare function isInterval<T extends Point>(value: unknown, typeGuard?: TypeGuard<T>): value is Interval<T>;
export declare function isIntervalLike<T extends Point>(value: unknown, typeGuard?: TypeGuard<T>): value is IntervalLike<T>;
export declare function isIntervalLikeOneOf<Ts extends ((value: unknown) => value is Point)[]>(value: unknown, typeGuards: [...Ts]): value is IntervalLike<TypeGuardType<Ts[number]>>;
export declare function isCalendarLike(value: unknown): value is Temporal.CalendarLike;
export declare function assertPoint<T extends Point>(value: unknown, typeGuard?: TypeGuard<T>, message?: string): asserts value is Point;
export declare function assertPointAny<Ts extends ((value: unknown) => value is Point)[]>(value: unknown, typeGuards: [...Ts]): asserts value is TypeGuardType<Ts[number]>;
export declare function assertPlainDateTime(value: unknown, message?: string): asserts value is PlainDateTime;
export declare function assertPlainTime(value: unknown, message?: string): asserts value is PlainTime;
export declare function assertPlainYearMonth(value: unknown, message?: string): asserts value is PlainYearMonth;
export declare function assertPlainDate(value: unknown, message?: string): asserts value is PlainDate;
export declare function assertInstant(value: unknown, message?: string): asserts value is Instant;
export declare function assertZonedDateTime(value: unknown, message?: string): asserts value is ZonedDateTime;
export declare function assertInterval<T extends Point>(value: unknown, typeGuard?: TypeGuard<T>, message?: string): asserts value is Interval<T>;
export declare function assertIntervalLike<T extends Point>(value: unknown, typeGuard?: TypeGuard<T>, message?: string): asserts value is IntervalLike<T>;