@heroiclands/package-build 22.16.0 → 22.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/bin/package-build.mjs +14 -2
- package/docs/api.md +22 -22
- package/docs/authoring/dates-and-calendars.md +63 -11
- package/docs/authoring/links-and-markup.md +1 -1
- package/docs/commands.md +8 -6
- package/docs/reference/format-details.md +107 -165
- package/docs/reference/note-types.md +11 -10
- package/engine/calendar-format.mjs +441 -0
- package/engine/calendar-human.mjs +65 -3
- package/engine/calendar-notes.mjs +277 -96
- package/engine/content-format.yaml +2 -1
- package/engine/date-conversion.mjs +4 -4
- package/engine/markdown-expressions.mjs +2 -1
- package/engine/note-dates.mjs +50 -22
- package/engine/reckoning-markers.mjs +154 -256
- package/package.json +1 -1
- package/types/engine/calendar-format.d.mts +33 -0
- package/types/engine/calendar-notes.d.mts +3 -3
- package/types/engine/date-conversion.d.mts +1 -1
- package/types/engine/note-dates.d.mts +2 -2
- package/types/engine/reckoning-markers.d.mts +13 -28
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Brackets and braces must close; `[[]` is a literal left bracket. */
|
|
2
|
+
export function calendarFormatSyntaxError(pattern: any): string | null;
|
|
3
|
+
/** Split a Calendaria pattern into tokens and literal text. */
|
|
4
|
+
export function calendarFormatSegments(pattern: any): {
|
|
5
|
+
token: boolean;
|
|
6
|
+
value: any;
|
|
7
|
+
}[];
|
|
8
|
+
/** A standard format must identify one calendar day and be readable without context. */
|
|
9
|
+
export function readableCalendarFormatError(pattern: any): string | null;
|
|
10
|
+
/** Whether a selected pattern prints clock components. */
|
|
11
|
+
export function calendarFormatHasClock(pattern: any): boolean;
|
|
12
|
+
/** Keep the fields named by an authored date's precision. */
|
|
13
|
+
export function calendarPatternSegmentsForPrecision(pattern: any, precision?: string, includeClock?: boolean): {
|
|
14
|
+
token: boolean;
|
|
15
|
+
value: any;
|
|
16
|
+
}[];
|
|
17
|
+
/** Choose an authored named format, with `std` as the preferred default. */
|
|
18
|
+
export function selectCalendarFormat(calendar: any, name: any): {
|
|
19
|
+
name: any;
|
|
20
|
+
pattern: any;
|
|
21
|
+
};
|
|
22
|
+
/** Format calendar date components with Calendaria's documented tokens. */
|
|
23
|
+
export function formatCalendarPattern(pattern: any, parts: any, precision?: string, includeClock?: boolean): string;
|
|
24
|
+
/** Read the invertible date fields of one Calendaria pattern. */
|
|
25
|
+
export function parseCalendarPattern(pattern: any, text: any, calendar: any): {
|
|
26
|
+
hour: number;
|
|
27
|
+
};
|
|
28
|
+
/** Convert a calendar month/day into its one-based day of year. */
|
|
29
|
+
export function calendarOrdinal(calendar: any, month: any, day: any): number;
|
|
30
|
+
/** Calendaria's bare date, time, week, season, and zone tokens. */
|
|
31
|
+
export const CALENDAR_FORMAT_TOKENS: Readonly<Set<string>>;
|
|
32
|
+
/** Calendaria's named fields inside brackets or braces. */
|
|
33
|
+
export const CALENDAR_CUSTOM_TOKENS: Readonly<Set<string>>;
|
|
@@ -18,7 +18,7 @@ export function worldInvariants(index?: object): {
|
|
|
18
18
|
yearNote: object | null;
|
|
19
19
|
moonNote: object | null;
|
|
20
20
|
};
|
|
21
|
-
/** Check each
|
|
21
|
+
/** Check each named pattern and the standard pattern's readable fields. */
|
|
22
22
|
export function checkCalendarDateFormats(note: any): {
|
|
23
23
|
severity: any;
|
|
24
24
|
message: any;
|
|
@@ -162,8 +162,7 @@ export const CALENDAR_SUBTYPE: "calendar";
|
|
|
162
162
|
export const INVARIANT_SUBTYPES: readonly string[];
|
|
163
163
|
/** Calendaria's display locations that a calendar note can format. */
|
|
164
164
|
export const CALENDAR_DATE_FORMAT_KEYS: readonly string[];
|
|
165
|
-
|
|
166
|
-
export const CALENDAR_FORMAT_TOKENS: Readonly<Set<string>>;
|
|
165
|
+
export { CALENDAR_FORMAT_TOKENS };
|
|
167
166
|
/**
|
|
168
167
|
* The `data:` keys a calendar note may write — the closed list, in authored
|
|
169
168
|
* order.
|
|
@@ -185,3 +184,4 @@ export const CALENDAR_FIELDS: readonly object[];
|
|
|
185
184
|
* @type {readonly object[]}
|
|
186
185
|
*/
|
|
187
186
|
export const INVARIANT_FIELDS: readonly object[];
|
|
187
|
+
import { CALENDAR_FORMAT_TOKENS } from "./calendar-format.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** Convert a day in an addressed calendar to its canonical spelling. */
|
|
2
2
|
export function dateFromCalendar(reference: any, value: any, context: any): string;
|
|
3
3
|
/** Convert a canonical day to the date in the covering era of a calendar. */
|
|
4
|
-
export function dateToCalendar(reference: any, value: any, context: any): any;
|
|
4
|
+
export function dateToCalendar(reference: any, value: any, context: any, formatName: any): any;
|
|
@@ -60,7 +60,7 @@ export function eraCovering(date: any, eraRows: any, daysPerYear: any): any;
|
|
|
60
60
|
/** Resolve a calendar or one of its eras from an Address or shortcode. */
|
|
61
61
|
export function calendarEras(reference: any, context: any): any;
|
|
62
62
|
/** Print a resolved date using the era active in one addressed calendar. */
|
|
63
|
-
export function formatDateInCalendar(date: any, reference: any, context: any): {
|
|
63
|
+
export function formatDateInCalendar(date: any, reference: any, context: any, formatName: any): {
|
|
64
64
|
era: null;
|
|
65
65
|
year: number;
|
|
66
66
|
text: any;
|
|
@@ -76,7 +76,7 @@ export function formatDateInCalendar(date: any, reference: any, context: any): {
|
|
|
76
76
|
prose: string | null;
|
|
77
77
|
} | null;
|
|
78
78
|
/** Print a resolved date in one era, retaining its authored precision. */
|
|
79
|
-
export function formatNoteDate(date: any, era: any, daysPerYear: any): {
|
|
79
|
+
export function formatNoteDate(date: any, era: any, daysPerYear: any, formatName: any): {
|
|
80
80
|
era: null;
|
|
81
81
|
year: number;
|
|
82
82
|
text: any;
|
|
@@ -1,29 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
eras: Map<string, object>;
|
|
13
|
-
markers: Map<string, object>;
|
|
14
|
-
findings: object[];
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Read the world's year length and its era markers from one corpus index.
|
|
18
|
-
*
|
|
19
|
-
* @param {{notes?: readonly object[]}|undefined} index - The corpus index.
|
|
20
|
-
* @returns {{eras: Map<string, object>, markers: Map<string, object>, daysPerYear: number|undefined, findings: object[]}}
|
|
21
|
-
*/
|
|
22
|
-
export function reckoningContext(index: {
|
|
23
|
-
notes?: readonly object[];
|
|
24
|
-
} | undefined): {
|
|
25
|
-
eras: Map<string, object>;
|
|
26
|
-
markers: Map<string, object>;
|
|
27
|
-
daysPerYear: number | undefined;
|
|
28
|
-
findings: object[];
|
|
1
|
+
/** Resolve calendar eras on the canonical day axis. */
|
|
2
|
+
export function resolveReckoningMarkers(index: any, daysPerYear: any): {
|
|
3
|
+
eras: Map<any, any>;
|
|
4
|
+
markers: Map<any, any>;
|
|
5
|
+
findings: {
|
|
6
|
+
severity: string;
|
|
7
|
+
message: string;
|
|
8
|
+
line?: number;
|
|
9
|
+
column?: number;
|
|
10
|
+
file?: any;
|
|
11
|
+
}[];
|
|
29
12
|
};
|
|
13
|
+
/** Read the world's year length and resolve every calendar era in one corpus. */
|
|
14
|
+
export function reckoningContext(index: any): any;
|