From 2eb7ebe9c3118da6c144a84db8faa8c48ebf7170 Mon Sep 17 00:00:00 2001 From: Josh Davari Date: Wed, 14 Jan 2026 21:44:24 -0800 Subject: [PATCH 1/3] Update Jsonix.Context constructor to include options parameter in .d.ts file --- typescript/src/main/typescript/Jsonix.d.ts | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/typescript/src/main/typescript/Jsonix.d.ts b/typescript/src/main/typescript/Jsonix.d.ts index 3b251b23d..8dd4d4507 100644 --- a/typescript/src/main/typescript/Jsonix.d.ts +++ b/typescript/src/main/typescript/Jsonix.d.ts @@ -64,13 +64,31 @@ interface Marshaller { // TODO: generics like marshalString(object:T):string; } declare module Jsonix { - export class Context { + export interface ContextOptions { + /** + * Maps namespace URIs to prefixes for XML serialization. + */ + namespacePrefixes?: { [namespaceUri: string]: string } + /** + * Whether to support xsi:type attributes during unmarshalling. + * Defaults to true. + */ + supportXsiType?: boolean + /** + * The mapping style to use. Can be a string identifier or a custom mapping style object. + * Defaults to 'standard'. + */ + mappingStyle?: 'standard' | 'simplified' | Object + } + + export class Context { /** * Creates an instance of Context. * * @param {any[]} s (description) + * @param {ContextOptions} options (description) */ - constructor(s:any[]); + constructor(s:any[], options?:ContextOptions); /** * (description) From 6764be1b0e5a95b4a81561947dabc6e752052413 Mon Sep 17 00:00:00 2001 From: Josh Davari Date: Wed, 14 Jan 2026 21:58:59 -0800 Subject: [PATCH 2/3] rename s to mappings --- typescript/src/main/typescript/Jsonix.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/typescript/src/main/typescript/Jsonix.d.ts b/typescript/src/main/typescript/Jsonix.d.ts index 8dd4d4507..06a2c3c06 100644 --- a/typescript/src/main/typescript/Jsonix.d.ts +++ b/typescript/src/main/typescript/Jsonix.d.ts @@ -85,10 +85,10 @@ declare module Jsonix { /** * Creates an instance of Context. * - * @param {any[]} s (description) - * @param {ContextOptions} options (description) + * @param {any[]} mappings Array of mapping modules that define XML/JSON schema definitions + * @param {ContextOptions} options Optional configuration options */ - constructor(s:any[], options?:ContextOptions); + constructor(mappings:any[], options?:ContextOptions); /** * (description) From 72b213a97d14b045e7e2b861ae5e26c44e553daf Mon Sep 17 00:00:00 2001 From: Josh Davari Date: Wed, 14 Jan 2026 22:00:36 -0800 Subject: [PATCH 3/3] fix indent --- typescript/src/main/typescript/Jsonix.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/typescript/src/main/typescript/Jsonix.d.ts b/typescript/src/main/typescript/Jsonix.d.ts index 06a2c3c06..7bdef6e6f 100644 --- a/typescript/src/main/typescript/Jsonix.d.ts +++ b/typescript/src/main/typescript/Jsonix.d.ts @@ -64,7 +64,7 @@ interface Marshaller { // TODO: generics like marshalString(object:T):string; } declare module Jsonix { - export interface ContextOptions { + export interface ContextOptions { /** * Maps namespace URIs to prefixes for XML serialization. */ @@ -79,9 +79,9 @@ declare module Jsonix { * Defaults to 'standard'. */ mappingStyle?: 'standard' | 'simplified' | Object - } + } - export class Context { + export class Context { /** * Creates an instance of Context. *