diff --git a/datetime/_common.ts b/datetime/_date_time_formatter.ts similarity index 98% rename from datetime/_common.ts rename to datetime/_date_time_formatter.ts index 12d011f2c324..39d515ff3c4c 100644 --- a/datetime/_common.ts +++ b/datetime/_date_time_formatter.ts @@ -1,34 +1,34 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // This module is browser compatible. -export type Token = { +type Token = { type: string; value: string | number; index: number; [key: string]: unknown; }; -export interface ReceiverResult { +interface ReceiverResult { [name: string]: string | number | unknown; } -export type CallbackResult = { +type CallbackResult = { type: string; value: string | number; [key: string]: unknown; }; type CallbackFunction = (value: unknown) => CallbackResult; -export type TestResult = { value: unknown; length: number } | undefined; -export type TestFunction = ( +type TestResult = { value: unknown; length: number } | undefined; +type TestFunction = ( string: string, ) => TestResult | undefined; -export interface Rule { +interface Rule { test: TestFunction; fn: CallbackFunction; } -export class Tokenizer { +class Tokenizer { rules: Rule[]; constructor(rules: Rule[] = []) { diff --git a/datetime/format.ts b/datetime/format.ts index 34aae1c25dde..8e05b4df2e5c 100644 --- a/datetime/format.ts +++ b/datetime/format.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // This module is browser compatible. -import { DateTimeFormatter } from "./_common.ts"; +import { DateTimeFormatter } from "./_date_time_formatter.ts"; /** Options for {@linkcode format}. */ export interface FormatOptions { diff --git a/datetime/parse.ts b/datetime/parse.ts index a6e2161b749a..13201cf35a1b 100644 --- a/datetime/parse.ts +++ b/datetime/parse.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // This module is browser compatible. -import { DateTimeFormatter } from "./_common.ts"; +import { DateTimeFormatter } from "./_date_time_formatter.ts"; /** * Parses a date string using the specified format string.