Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions typescript/src/main/typescript/Jsonix.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,31 @@ interface Marshaller { // TODO: generics like marshalString(object:T):string;
}

declare module Jsonix {
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 {any[]} mappings Array of mapping modules that define XML/JSON schema definitions
* @param {ContextOptions} options Optional configuration options
*/
constructor(s:any[]);
constructor(mappings:any[], options?:ContextOptions);

/**
* (description)
Expand Down