registration

This commit is contained in:
User
2025-02-02 16:08:03 +03:00
parent 7f6495eb4d
commit 78afbaed71
6334 changed files with 196774 additions and 165754 deletions

View File

@@ -1,9 +1,10 @@
import type { ContextOptions } from "./types.js";
/**
* The {@link parseJSON} function options.
*/
export interface ParseJSONOptions<DateType extends Date = Date>
extends ContextOptions<DateType> {}
/**
* @name parseJSON
* @category Common Helpers
* @summary Parse a JSON date string
*
* @description
* Converts a complete ISO date string in UTC time, the typical format for transmitting
* a date in JSON, to a JavaScript `Date` instance.
*
@@ -28,8 +29,14 @@
*
* Any other input type or invalid date strings will return an `Invalid Date`.
*
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param dateStr - A fully formed ISO8601 date string to convert
* @param options - An object with options
*
* @returns The parsed date in the local time zone
*/
export declare function parseJSON(dateStr: string): Date;
export declare function parseJSON<ResultDate extends Date = Date>(
dateStr: string,
options?: ParseJSONOptions<ResultDate> | undefined,
): ResultDate;