···163163extern dec errors(target: unknown, ...errors: unknown[]);
164164165165/**
166166+ * Forces a model, scalar, or union to be inlined instead of creating a standalone def.
167167+ * By default, named types create separate definitions with references.
168168+ * Use @inline to expand the type inline at each usage site.
169169+ *
170170+ * @example Inline model
171171+ * ```typespec
172172+ * @inline
173173+ * model Caption {
174174+ * text?: string;
175175+ * }
176176+ *
177177+ * model Main {
178178+ * captions?: Caption[]; // Expands inline, no separate "caption" def
179179+ * }
180180+ * ```
181181+ *
182182+ * @example Inline scalar
183183+ * ```typespec
184184+ * @inline
185185+ * @maxLength(50)
186186+ * scalar Handle extends string;
187187+ *
188188+ * model Main {
189189+ * handle?: Handle; // Expands to { type: "string", maxLength: 50 }
190190+ * }
191191+ * ```
192192+ *
193193+ * @example Inline union
194194+ * ```typespec
195195+ * @inline
196196+ * union Status { "active", "inactive", string }
197197+ *
198198+ * model Main {
199199+ * status?: Status; // Expands inline with knownValues
200200+ * }
201201+ * ```
202202+ */
203203+extern dec inline(target: unknown);
204204+205205+/**
206206+ * Specifies a default value for a scalar or union definition.
207207+ * Only valid on standalone scalar or union defs (not @inline).
208208+ * The value must match the underlying type (string, integer, or boolean).
209209+ * For unions with token refs, you can pass a model reference directly.
210210+ *
211211+ * @param value - The default value (literal or model reference for tokens)
212212+ *
213213+ * @example Scalar with default
214214+ * ```typespec
215215+ * @default("standard")
216216+ * scalar Mode extends string;
217217+ * ```
218218+ *
219219+ * @example Union with token default
220220+ * ```typespec
221221+ * @default(Inperson)
222222+ * union EventMode { Hybrid, Inperson, Virtual, string }
223223+ *
224224+ * @token
225225+ * model Inperson {}
226226+ * ```
227227+ */
228228+extern dec `default`(target: unknown, value: unknown);
229229+230230+/**
166231 * Marks a namespace as external, preventing it from emitting JSON output.
167232 * This decorator can only be applied to namespaces.
+17
packages/emitter/src/decorators.ts
···2525const maxBytesKey = Symbol("maxBytes");
2626const minBytesKey = Symbol("minBytes");
2727const externalKey = Symbol("external");
2828+const defaultKey = Symbol("default");
28292930/**
3031 * @maxBytes decorator for maximum length of bytes type
···296297 return program.stateSet(readOnlyKey).has(target);
297298}
298299300300+/**
301301+ * @default decorator for setting default values on scalars and unions
302302+ * The value can be a literal (string, number, boolean) or a model reference for tokens
303303+ */
304304+export function $default(context: DecoratorContext, target: Type, value: any) {
305305+ // Just store the raw value - let the emitter handle unwrapping and validation
306306+ context.program.stateMap(defaultKey).set(target, value);
307307+}
308308+309309+export function getDefault(
310310+ program: Program,
311311+ target: Type,
312312+): any | undefined {
313313+ return program.stateMap(defaultKey).get(target);
314314+}
315315+299316/**
300317 * @external decorator for marking a namespace as external
301318 * External namespaces are skipped during emission and don't produce JSON files
+297-33
packages/emitter/src/emitter.ts
···4545464647474848+ LexCidLink,
4949+ LexRefVariant,
5050+ LexToken,
5151+ LexBoolean,
5252+ LexInteger,
5353+ LexString,
5454+} from "./types.js";
48555656+import {
495750585159···6068616962706363-6464-6565-6666-6767-6871 getMaxBytes,
6972 getMinBytes,
7073 isExternal,
7474+ getDefault,
7175} from "./decorators.js";
72767377export interface EmitterOptions {
···98102 private options: EmitterOptions,
99103 ) {}
100104105105+ /**
106106+ * Process the raw default value from the decorator, unwrapping TypeSpec value objects
107107+ * and returning either a primitive (string, number, boolean) or a Type (for model references)
108108+ */
109109+ private processDefaultValue(rawValue: any): string | number | boolean | Type | undefined {
110110+ if (rawValue === undefined) return undefined;
111111+112112+ // TypeSpec may wrap values - check if this is a value object first
113113+ if (rawValue && typeof rawValue === 'object' && rawValue.valueKind) {
114114+ if (rawValue.valueKind === "StringValue") {
115115+ return rawValue.value;
116116+ } else if (rawValue.valueKind === "NumericValue" || rawValue.valueKind === "NumberValue") {
117117+ return rawValue.value;
118118+ } else if (rawValue.valueKind === "BooleanValue") {
119119+ return rawValue.value;
120120+ }
121121+ return undefined; // Unsupported valueKind
122122+ }
123123+124124+ // Check if it's a Type object (Model, String, Number, Boolean literals)
125125+ if (rawValue && typeof rawValue === 'object' && rawValue.kind) {
126126+ if (rawValue.kind === "String") {
127127+ return (rawValue as StringLiteral).value;
128128+ } else if (rawValue.kind === "Number") {
129129+ return (rawValue as NumericLiteral).value;
130130+ } else if (rawValue.kind === "Boolean") {
131131+ return (rawValue as BooleanLiteral).value;
132132+ } else if (rawValue.kind === "Model") {
133133+ // Return the model itself for token references
134134+ return rawValue as Model;
135135+ }
136136+ return undefined; // Unsupported kind
137137+ }
138138+139139+ // Direct primitive value
140140+ if (typeof rawValue === 'string' || typeof rawValue === 'number' || typeof rawValue === 'boolean') {
141141+ return rawValue;
142142+ }
143143+144144+ return undefined;
145145+ }
146146+101147 async emit() {
102148 const globalNs = this.program.getGlobalNamespaceType();
103149···356402 }
357403358404 private addScalarToDefs(lexicon: LexiconDoc, scalar: Scalar) {
405405+ // Only skip if the scalar itself is in TypeSpec namespace (built-in scalars)
359406 if (scalar.namespace?.name === "TypeSpec") return;
360360- if (scalar.baseScalar?.namespace?.name === "TypeSpec") return;
361407362408 // Skip @inline scalars - they should be inlined, not defined separately
363409 if (isInline(this.program, scalar)) {
···368414 const scalarDef = this.scalarToLexiconPrimitive(scalar, undefined);
369415 if (scalarDef) {
370416 const description = getDoc(this.program, scalar);
371371- lexicon.defs[defName] = { ...scalarDef, description } as LexUserType;
417417+418418+ // Apply @default decorator if present
419419+ const rawDefault = getDefault(this.program, scalar);
420420+ const defaultValue = this.processDefaultValue(rawDefault);
421421+ let defWithDefault: LexObjectProperty = { ...scalarDef };
422422+423423+ if (defaultValue !== undefined) {
424424+ // Check if it's a Type (model reference for tokens)
425425+ if (typeof defaultValue === 'object' && 'kind' in defaultValue) {
426426+ // For model references, we need to resolve to NSID
427427+ // This shouldn't happen for scalars, only unions support token refs
428428+ this.program.reportDiagnostic({
429429+ code: "invalid-default-on-scalar",
430430+ severity: "error",
431431+ message: "@default on scalars must be a literal value (string, number, or boolean), not a model reference",
432432+ target: scalar,
433433+ });
434434+ } else {
435435+ // Validate that the default value matches the type
436436+ this.assertValidValueForType(scalarDef.type, defaultValue, scalar);
437437+ // Type-safe narrowing based on both the type discriminator and value type
438438+ if (scalarDef.type === "boolean" && typeof defaultValue === "boolean") {
439439+ (defWithDefault as LexBoolean).default = defaultValue;
440440+ } else if (scalarDef.type === "integer" && typeof defaultValue === "number") {
441441+ (defWithDefault as LexInteger).default = defaultValue;
442442+ } else if (scalarDef.type === "string" && typeof defaultValue === "string") {
443443+ (defWithDefault as LexString).default = defaultValue;
444444+ }
445445+ }
446446+ }
447447+448448+ // Apply integer constraints for standalone scalar defs
449449+ if (scalarDef.type === "integer") {
450450+ const minValue = getMinValue(this.program, scalar);
451451+ if (minValue !== undefined) {
452452+ (defWithDefault as LexInteger).minimum = minValue;
453453+ }
454454+ const maxValue = getMaxValue(this.program, scalar);
455455+ if (maxValue !== undefined) {
456456+ (defWithDefault as LexInteger).maximum = maxValue;
457457+ }
458458+ }
459459+460460+ lexicon.defs[defName] = { ...defWithDefault, description } as LexUserType;
372461 }
373462 }
374463···391480 if (unionDef.type === "string" && (unionDef.knownValues || unionDef.enum)) {
392481 const defName = name.charAt(0).toLowerCase() + name.slice(1);
393482 const description = getDoc(this.program, union);
394394- lexicon.defs[defName] = { ...unionDef, description };
483483+484484+ // Apply @default decorator if present
485485+ const rawDefault = getDefault(this.program, union);
486486+ const defaultValue = this.processDefaultValue(rawDefault);
487487+ let defWithDefault: LexString = { ...unionDef as LexString };
488488+489489+ if (defaultValue !== undefined) {
490490+ // Check if it's a Type (model reference for tokens)
491491+ if (typeof defaultValue === 'object' && 'kind' in defaultValue) {
492492+ // Resolve the model reference to its NSID
493493+ const tokenModel = defaultValue as Model;
494494+ const tokenRef = this.getModelReference(tokenModel, true); // fullyQualified=true
495495+ if (tokenRef) {
496496+ defWithDefault = { ...defWithDefault, default: tokenRef };
497497+ } else {
498498+ this.program.reportDiagnostic({
499499+ code: "invalid-default-token",
500500+ severity: "error",
501501+ message: "@default value must be a valid token model reference",
502502+ target: union,
503503+ });
504504+ }
505505+ } else {
506506+ // Literal value - validate it matches the union type
507507+ if (typeof defaultValue !== "string") {
508508+ this.program.reportDiagnostic({
509509+ code: "invalid-default-value-type",
510510+ severity: "error",
511511+ message: `Default value type mismatch: expected string, got ${typeof defaultValue}`,
512512+ target: union,
513513+ });
514514+ } else {
515515+ defWithDefault = { ...defWithDefault, default: defaultValue };
516516+ }
517517+ }
518518+ }
519519+520520+ lexicon.defs[defName] = { ...defWithDefault, description };
395521 } else if (unionDef.type === "union") {
396522 this.program.reportDiagnostic({
397523 code: "union-refs-not-allowed-as-def",
···401527 `Use @inline to inline them at usage sites, use @token models for known values, or use string literals.`,
402528 target: union,
403529 });
404404- }
405405- }
530530+ } else if (unionDef.type === "integer" && (unionDef as LexInteger).enum) {
531531+ // Integer enums can also be defs
532532+ const defName = name.charAt(0).toLowerCase() + name.slice(1);
533533+ const description = getDoc(this.program, union);
406534535535+ // Apply @default decorator if present
536536+ const rawDefault = getDefault(this.program, union);
537537+ const defaultValue = this.processDefaultValue(rawDefault);
538538+ let defWithDefault: LexInteger = { ...unionDef as LexInteger };
407539540540+ if (defaultValue !== undefined) {
541541+ if (typeof defaultValue === "number") {
542542+ defWithDefault = { ...defWithDefault, default: defaultValue };
543543+ } else {
544544+ this.program.reportDiagnostic({
545545+ code: "invalid-default-value-type",
546546+ severity: "error",
547547+ message: `Default value type mismatch: expected integer, got ${typeof defaultValue}`,
548548+ target: union,
549549+ });
550550+ }
551551+ }
408552553553+ lexicon.defs[defName] = { ...defWithDefault, description };
554554+ }
555555+ }
409556410557411558···501648502649503650651651+ isClosed(this.program, unionType)
652652+ ) {
653653+ const propDesc = prop ? getDoc(this.program, prop) : undefined;
504654655655+ // Check for default value: property default takes precedence, then union's @default
656656+ let defaultValue: string | number | boolean | undefined;
657657+ if (prop?.defaultValue !== undefined) {
658658+ defaultValue = serializeValueAsJson(this.program, prop.defaultValue, prop) as string | number | boolean;
659659+ } else {
660660+ // If no property default, check union's @default decorator
661661+ const rawUnionDefault = getDefault(this.program, unionType);
662662+ const unionDefault = this.processDefaultValue(rawUnionDefault);
663663+ if (unionDefault !== undefined && typeof unionDefault === 'number') {
664664+ defaultValue = unionDefault;
665665+ }
666666+ }
505667668668+ return {
669669+ type: "integer",
670670+ enum: variants.numericLiterals,
506671507672508673···519684520685521686687687+ ) {
688688+ const isClosedUnion = isClosed(this.program, unionType);
689689+ const propDesc = prop ? getDoc(this.program, prop) : undefined;
522690691691+ // Check for default value: property default takes precedence, then union's @default
692692+ let defaultValue: string | number | boolean | undefined;
693693+ if (prop?.defaultValue !== undefined) {
694694+ defaultValue = serializeValueAsJson(this.program, prop.defaultValue, prop) as string | number | boolean;
695695+ } else {
696696+ // If no property default, check union's @default decorator
697697+ const rawUnionDefault = getDefault(this.program, unionType);
698698+ const unionDefault = this.processDefaultValue(rawUnionDefault);
523699700700+ if (unionDefault !== undefined) {
701701+ // Check if it's a Type (model reference for tokens)
702702+ if (typeof unionDefault === 'object' && 'kind' in unionDefault && unionDefault.kind === 'Model') {
703703+ // Resolve the model reference to its NSID
704704+ const tokenModel = unionDefault as Model;
705705+ const tokenRef = this.getModelReference(tokenModel, true); // fullyQualified=true
706706+ if (tokenRef) {
707707+ defaultValue = tokenRef;
708708+ }
709709+ } else if (typeof unionDefault === 'string') {
710710+ defaultValue = unionDefault;
711711+ }
712712+ }
713713+ }
524714715715+ const maxLength = getMaxLength(this.program, unionType);
716716+ const minLength = getMinLength(this.program, unionType);
717717+ const maxGraphemes = getMaxGraphemes(this.program, unionType);
525718526719527720···11451338114613391147134011481148-11491149-11501150-11511151-11521152-11531153-11541154-11551155-11561156-11571157-11581341 prop?: ModelProperty,
11591342 propDesc?: string,
11601343 ): LexObjectProperty | null {
13441344+ // Check if this scalar should be referenced instead of inlined
13451345+ const scalarRef = this.getScalarReference(scalar);
13461346+ if (scalarRef) {
13471347+ // Check if property has a default value that would conflict with the scalar's @default
13481348+ if (prop?.defaultValue !== undefined) {
13491349+ const scalarDefaultRaw = getDefault(this.program, scalar);
13501350+ const scalarDefault = this.processDefaultValue(scalarDefaultRaw);
13511351+ const propDefault = serializeValueAsJson(this.program, prop.defaultValue, prop);
13521352+13531353+ // If the scalar has a different default, or if the property has a default but the scalar doesn't, error
13541354+ if (scalarDefault !== propDefault) {
13551355+ this.program.reportDiagnostic({
13561356+ code: "conflicting-defaults",
13571357+ severity: "error",
13581358+ message: scalarDefault !== undefined
13591359+ ? `Property default value conflicts with scalar's @default decorator. The scalar "${scalar.name}" has @default(${JSON.stringify(scalarDefault)}) but property has default value ${JSON.stringify(propDefault)}. Either remove the property default, mark the scalar @inline, or make the defaults match.`
13601360+ : `Property has a default value but the referenced scalar "${scalar.name}" does not. Either add @default to the scalar, mark it @inline to allow property-level defaults, or remove the property default.`,
13611361+ target: prop,
13621362+ });
13631363+ }
13641364+ }
13651365+13661366+ return { type: "ref" as const, ref: scalarRef, description: propDesc };
13671367+ }
13681368+13691369+ // Inline the scalar
11611370 const primitive = this.scalarToLexiconPrimitive(scalar, prop);
11621371 if (!primitive) return null;
11631372···12461455 if (!isDefining) {
12471456 const unionRef = this.getUnionReference(unionType);
12481457 if (unionRef) {
14581458+ // Check if property has a default value that would conflict with the union's @default
14591459+ if (prop?.defaultValue !== undefined) {
14601460+ const unionDefaultRaw = getDefault(this.program, unionType);
14611461+ const unionDefault = this.processDefaultValue(unionDefaultRaw);
14621462+ const propDefault = serializeValueAsJson(this.program, prop.defaultValue, prop);
14631463+14641464+ // For union defaults that are model references, we need to resolve them for comparison
14651465+ let resolvedUnionDefault: string | number | boolean | undefined;
14661466+ if (unionDefault && typeof unionDefault === 'object' && 'kind' in unionDefault && unionDefault.kind === 'Model') {
14671467+ const ref = this.getModelReference(unionDefault as Model, true);
14681468+ resolvedUnionDefault = ref || undefined;
14691469+ } else {
14701470+ resolvedUnionDefault = unionDefault as string | number | boolean;
14711471+ }
14721472+14731473+ // If the union has a different default, or if the property has a default but the union doesn't, error
14741474+ if (resolvedUnionDefault !== propDefault) {
14751475+ this.program.reportDiagnostic({
14761476+ code: "conflicting-defaults",
14771477+ severity: "error",
14781478+ message: unionDefault !== undefined
14791479+ ? `Property default value conflicts with union's @default decorator. The union "${unionType.name}" has @default(${JSON.stringify(resolvedUnionDefault)}) but property has default value ${JSON.stringify(propDefault)}. Either remove the property default, mark the union @inline, or make the defaults match.`
14801480+ : `Property has a default value but the referenced union "${unionType.name}" does not. Either add @default to the union, mark it @inline to allow property-level defaults, or remove the property default.`,
14811481+ target: prop,
14821482+ });
14831483+ }
14841484+ }
14851485+12491486 return { type: "ref" as const, ref: unionRef, description: propDesc };
12501487 }
12511488 }
···12711508 // Check if this scalar (or its base) is bytes type
12721509 if (this.isScalarOfType(scalar, "bytes")) {
12731510 const byteDef: LexBytes = { type: "bytes" };
12741274- const target = prop || scalar;
1275151112761276- const minLength = getMinBytes(this.program, target);
15121512+ // Check scalar first for its own constraints, then property overrides
15131513+ const minLength = getMinBytes(this.program, scalar) ?? (prop ? getMinBytes(this.program, prop) : undefined);
12771514 if (minLength !== undefined) {
12781515 byteDef.minLength = minLength;
12791516 }
1280151712811281- const maxLength = getMaxBytes(this.program, target);
15181518+ const maxLength = getMaxBytes(this.program, scalar) ?? (prop ? getMaxBytes(this.program, prop) : undefined);
12821519 if (maxLength !== undefined) {
12831520 byteDef.maxLength = maxLength;
12841521 }
···1310154713111548 // Apply string constraints
13121549 if (primitive.type === "string") {
13131313- const target = prop || scalar;
13141314- const maxLength = getMaxLength(this.program, target);
15501550+ // Check scalar first for its own constraints, then property overrides
15511551+ const maxLength = getMaxLength(this.program, scalar) ?? (prop ? getMaxLength(this.program, prop) : undefined);
13151552 if (maxLength !== undefined) {
13161553 primitive.maxLength = maxLength;
13171554 }
13181318- const minLength = getMinLength(this.program, target);
15551555+ const minLength = getMinLength(this.program, scalar) ?? (prop ? getMinLength(this.program, prop) : undefined);
13191556 if (minLength !== undefined) {
13201557 primitive.minLength = minLength;
13211558 }
13221322- const maxGraphemes = getMaxGraphemes(this.program, target);
15591559+ const maxGraphemes = getMaxGraphemes(this.program, scalar) ?? (prop ? getMaxGraphemes(this.program, prop) : undefined);
13231560 if (maxGraphemes !== undefined) {
13241561 primitive.maxGraphemes = maxGraphemes;
13251562 }
13261326- const minGraphemes = getMinGraphemes(this.program, target);
15631563+ const minGraphemes = getMinGraphemes(this.program, scalar) ?? (prop ? getMinGraphemes(this.program, prop) : undefined);
13271564 if (minGraphemes !== undefined) {
13281565 primitive.minGraphemes = minGraphemes;
13291566 }
13301567 }
1331156813321569 // Apply numeric constraints
13331333- if (prop && primitive.type === "integer") {
13341334- const minValue = getMinValue(this.program, prop);
15701570+ if (primitive.type === "integer") {
15711571+ // Check scalar first for its own constraints, then property overrides
15721572+ const minValue = getMinValue(this.program, scalar) ?? (prop ? getMinValue(this.program, prop) : undefined);
13351573 if (minValue !== undefined) {
13361574 primitive.minimum = minValue;
13371575 }
13381338- const maxValue = getMaxValue(this.program, prop);
15761576+ const maxValue = getMaxValue(this.program, scalar) ?? (prop ? getMaxValue(this.program, prop) : undefined);
13391577 if (maxValue !== undefined) {
13401578 primitive.maximum = maxValue;
13411579 }
···14311669 private assertValidValueForType(
14321670 primitiveType: string,
14331671 value: unknown,
14341434- prop: ModelProperty,
16721672+ target: ModelProperty | Scalar | Union,
14351673 ): void {
14361674 const valid =
14371675 (primitiveType === "boolean" && typeof value === "boolean") ||
···14421680 code: "invalid-default-value-type",
14431681 severity: "error",
14441682 message: `Default value type mismatch: expected ${primitiveType}, got ${typeof value}`,
14451445- target: prop,
16831683+ target: target,
14461684 });
14471685 }
14481686 }
···150717451508174615091747 return this.getReference(union, union.name, union.namespace);
17481748+ }
17491749+17501750+ private getScalarReference(scalar: Scalar): string | null {
17511751+ // Built-in TypeSpec scalars (string, integer, boolean themselves) should not be referenced
17521752+ if (scalar.namespace?.name === "TypeSpec") return null;
17531753+17541754+ // @inline scalars should be inlined, not referenced
17551755+ if (isInline(this.program, scalar)) return null;
17561756+17571757+ // Scalars without names or namespace can't be referenced
17581758+ if (!scalar.name || !scalar.namespace) return null;
17591759+17601760+ const defName = scalar.name.charAt(0).toLowerCase() + scalar.name.slice(1);
17611761+ const namespaceName = getNamespaceFullName(scalar.namespace);
17621762+ if (!namespaceName) return null;
17631763+17641764+ // Local reference (same namespace) - use short ref
17651765+ if (
17661766+ this.currentLexiconId === namespaceName ||
17671767+ this.currentLexiconId === `${namespaceName}.defs`
17681768+ ) {
17691769+ return `#${defName}`;
17701770+ }
17711771+17721772+ // Cross-namespace reference
17731773+ return `${namespaceName}#${defName}`;
15101774 }
1511177515121776 private modelToLexiconArray(
···11+import "@typelex/emitter";
22+33+namespace com.example.scalarDefaults {
44+ /** Test default decorator on scalars */
55+ model Main {
66+ /** Uses string scalar with default */
77+ mode?: Mode;
88+99+ /** Uses integer scalar with default */
1010+ limit?: Limit;
1111+1212+ /** Uses boolean scalar with default */
1313+ enabled?: Enabled;
1414+ }
1515+1616+ /** A string type with a default value */
1717+ @default("standard")
1818+ @maxLength(50)
1919+ scalar Mode extends string;
2020+2121+ /** An integer type with a default value */
2222+ @default(50)
2323+ @minValue(1)
2424+ @maxValue(100)
2525+ scalar Limit extends integer;
2626+2727+ /** A boolean type with a default value */
2828+ @default(true)
2929+ scalar Enabled extends boolean;
3030+}
···11+import "@typelex/emitter";
22+33+namespace community.lexicon.calendar.event {
44+ /** A calendar event. */
55+ @rec("tid")
66+ model Main {
77+ /** The name of the event. */
88+ @required
99+ name: string;
1010+1111+ /** The description of the event. */
1212+ description?: string;
1313+1414+ /** Client-declared timestamp when the event was created. */
1515+ @required
1616+ createdAt: datetime;
1717+1818+ /** Client-declared timestamp when the event starts. */
1919+ startsAt?: datetime;
2020+2121+ /** Client-declared timestamp when the event ends. */
2222+ endsAt?: datetime;
2323+2424+ /** The attendance mode of the event. */
2525+ mode?: Mode;
2626+2727+ /** The status of the event. */
2828+ status?: Status;
2929+3030+ /** The locations where the event takes place. */
3131+ locations?: (
3232+ | Uri
3333+ | community.lexicon.location.address.Main
3434+ | community.lexicon.location.fsq.Main
3535+ | community.lexicon.location.geo.Main
3636+ | community.lexicon.location.hthree.Main
3737+ )[];
3838+3939+ /** URIs associated with the event. */
4040+ uris?: Uri[];
4141+ }
4242+4343+ /** The mode of the event. */
4444+ @default(Inperson)
4545+ union Mode {
4646+ Hybrid,
4747+ Inperson,
4848+ Virtual,
4949+ string,
5050+ }
5151+5252+ /** A virtual event that takes place online. */
5353+ @token
5454+ model Virtual {}
5555+5656+ /** An in-person event that takes place offline. */
5757+ @token
5858+ model Inperson {}
5959+6060+ /** A hybrid event that takes place both online and offline. */
6161+ @token
6262+ model Hybrid {}
6363+6464+ /** The status of the event. */
6565+ @default(Scheduled)
6666+ union Status {
6767+ Cancelled,
6868+ Planned,
6969+ Postponed,
7070+ Rescheduled,
7171+ Scheduled,
7272+ string,
7373+ }
7474+7575+ /** The event has been created, but not finalized. */
7676+ @token
7777+ model Planned {}
7878+7979+ /** The event has been created and scheduled. */
8080+ @token
8181+ model Scheduled {}
8282+8383+ /** The event has been rescheduled. */
8484+ @token
8585+ model Rescheduled {}
8686+8787+ /** The event has been cancelled. */
8888+ @token
8989+ model Cancelled {}
9090+9191+ /** The event has been postponed and a new start date has not been set. */
9292+ @token
9393+ model Postponed {}
9494+9595+ /** A URI associated with the event. */
9696+ model Uri {
9797+ @required
9898+ uri: uri;
9999+100100+ /** The display name of the URI. */
101101+ name?: string;
102102+ }
103103+}
104104+105105+// --- Externals ---
106106+107107+@external
108108+namespace community.lexicon.location.address {
109109+ model Main {}
110110+}
111111+112112+@external
113113+namespace community.lexicon.location.fsq {
114114+ model Main {}
115115+}
116116+117117+@external
118118+namespace community.lexicon.location.geo {
119119+ model Main {}
120120+}
121121+122122+@external
123123+namespace community.lexicon.location.hthree {
124124+ model Main {}
125125+}