Skip to content

Fix typescript definition #237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
250 changes: 126 additions & 124 deletions typescript/src/main/typescript/Jsonix.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,115 +63,117 @@ interface Marshaller { // TODO: generics like marshalString(object:T):string;
marshalDocument(object:Object): Element;
}

declare module Jsonix {
export class Context {
/**
* Creates an instance of Context.
*
* @param {any[]} s (description)
*/
constructor(s:any[]);

/**
* (description)
*
* @param {string} name (description)
* @returns {TypeInfo} (description)
*/
getTypeInfoByName(name:string):TypeInfo;

/**
* (description)
*
* @param {string} typeName (description)
* @returns {TypeInfo} (description)
*/
getTypeInfoByTypeName(typeName:string):TypeInfo;

/**
* (description)
*
* @param {string} typeNameKey (description)
* @returns {TypeInfo} (description)
*/
getTypeInfoByTypeNameKey(typeNameKey:string):TypeInfo;

getElementInfo(name:string, scope:string):any;

getSubstitutionMembers(name:string):any;

createMarshaller():Marshaller;

createUnmarshaller():Unmarshaller;

//TODO: createUnmarshaller<T>(type: T): Unmarshaller<T>;

getNamespaceURI(prefix:string):any;

getPrefix(namespaceURI:string, defaultPrefix:string):any;

builtinTypeInfos:{
Jsonix: {
Schema: {
XSD: {
AnyType: { INSTANCE: {} };
AnySimpleType: { INSTANCE: {} };
AnyURI: { INSTANCE: {} };
Base64Binary: { INSTANCE: {} };
Boolean: { INSTANCE: {} };
Byte: { INSTANCE: {} };
Calendar: { INSTANCE: {} };
DateAsDate: { INSTANCE: {} };
Date: { INSTANCE: {} };
DateTimeAsDate: { INSTANCE: {} };
DateTime: { INSTANCE: {} };
Decimal: { INSTANCE: {} };
Double: { INSTANCE: {} };
Duration: { INSTANCE: {} };
Float: { INSTANCE: {} };
GDay: { INSTANCE: {} };
GMonth: { INSTANCE: {} };
GMonthDay: { INSTANCE: {} };
GYear: { INSTANCE: {} };
GYearMonth: { INSTANCE: {} };
HexBinary: { INSTANCE: {} };
ID: { INSTANCE: {} };
IDREF: { INSTANCE: {} };
IDREFS: { INSTANCE: {} };
Int: { INSTANCE: {} };
Integer: { INSTANCE: {} };
Language: { INSTANCE: {} };
Long: { INSTANCE: {} };
Name: { INSTANCE: {} };
NCName: { INSTANCE: {} };
NegativeInteger: { INSTANCE: {} };
NMToken: { INSTANCE: {} };
NMTokens: { INSTANCE: {} };
NonNegativeInteger: { INSTANCE: {} };
NonPositiveInteger: { INSTANCE: {} };
NormalizedString: { INSTANCE: {} };
Number: { INSTANCE: {} };
PositiveInteger: { INSTANCE: {} };
QName: { INSTANCE: {} };
Short: { INSTANCE: {} };
String: { INSTANCE: {} };
Strings: { INSTANCE: {} };
TimeAsDate: { INSTANCE: {} };
Time: { INSTANCE: {} };
Token: { INSTANCE: {} };
UnsignedByte: { INSTANCE: {} };
UnsignedInt: { INSTANCE: {} };
UnsignedLong: { INSTANCE: {} };
UnsignedShort: { INSTANCE: {} };
declare module 'jsonix' {
export namespace Jsonix {
export class Context {
/**
* Creates an instance of Context.
*
* @param {any[]} s (description)
*/
constructor(s:any[]);

/**
* (description)
*
* @param {string} name (description)
* @returns {TypeInfo} (description)
*/
getTypeInfoByName(name:string):TypeInfo;

/**
* (description)
*
* @param {string} typeName (description)
* @returns {TypeInfo} (description)
*/
getTypeInfoByTypeName(typeName:string):TypeInfo;

/**
* (description)
*
* @param {string} typeNameKey (description)
* @returns {TypeInfo} (description)
*/
getTypeInfoByTypeNameKey(typeNameKey:string):TypeInfo;

getElementInfo(name:string, scope:string):any;

getSubstitutionMembers(name:string):any;

createMarshaller():Marshaller;

createUnmarshaller():Unmarshaller;

//TODO: createUnmarshaller<T>(type: T): Unmarshaller<T>;

getNamespaceURI(prefix:string):any;

getPrefix(namespaceURI:string, defaultPrefix:string):any;

builtinTypeInfos:{
Jsonix: {
Schema: {
XSD: {
AnyType: { INSTANCE: {} };
AnySimpleType: { INSTANCE: {} };
AnyURI: { INSTANCE: {} };
Base64Binary: { INSTANCE: {} };
Boolean: { INSTANCE: {} };
Byte: { INSTANCE: {} };
Calendar: { INSTANCE: {} };
DateAsDate: { INSTANCE: {} };
Date: { INSTANCE: {} };
DateTimeAsDate: { INSTANCE: {} };
DateTime: { INSTANCE: {} };
Decimal: { INSTANCE: {} };
Double: { INSTANCE: {} };
Duration: { INSTANCE: {} };
Float: { INSTANCE: {} };
GDay: { INSTANCE: {} };
GMonth: { INSTANCE: {} };
GMonthDay: { INSTANCE: {} };
GYear: { INSTANCE: {} };
GYearMonth: { INSTANCE: {} };
HexBinary: { INSTANCE: {} };
ID: { INSTANCE: {} };
IDREF: { INSTANCE: {} };
IDREFS: { INSTANCE: {} };
Int: { INSTANCE: {} };
Integer: { INSTANCE: {} };
Language: { INSTANCE: {} };
Long: { INSTANCE: {} };
Name: { INSTANCE: {} };
NCName: { INSTANCE: {} };
NegativeInteger: { INSTANCE: {} };
NMToken: { INSTANCE: {} };
NMTokens: { INSTANCE: {} };
NonNegativeInteger: { INSTANCE: {} };
NonPositiveInteger: { INSTANCE: {} };
NormalizedString: { INSTANCE: {} };
Number: { INSTANCE: {} };
PositiveInteger: { INSTANCE: {} };
QName: { INSTANCE: {} };
Short: { INSTANCE: {} };
String: { INSTANCE: {} };
Strings: { INSTANCE: {} };
TimeAsDate: { INSTANCE: {} };
Time: { INSTANCE: {} };
Token: { INSTANCE: {} };
UnsignedByte: { INSTANCE: {} };
UnsignedInt: { INSTANCE: {} };
UnsignedLong: { INSTANCE: {} };
UnsignedShort: { INSTANCE: {} };
}
}
}
}
}[];
}[];


// private
elementInfos:ClassInfo[];
// private
elementInfos:ClassInfo[];

}
}
}

Expand Down Expand Up @@ -253,7 +255,7 @@ interface PropertyInfo {
interface AbstractElementPropertyInfo extends PropertyInfo {
wrapperElement: QName;
allowDom: boolean;
allowTypedObject; boolean;
allowTypedObject: boolean;
mixed: boolean;
}

Expand Down Expand Up @@ -298,24 +300,24 @@ interface ClassInfo extends TypeInfo, Styled {
built: boolean;
//TODO: confirm this syntax
propertyInfoCreators: {
aa: { aa };
anyAttribute: { aa };
ae: { ae };
anyElement: { ae };
a: { a };
attribute: { a };
em: { em };
elementMap: { em };
e: { e };
element: { e };
es: { es };
elements: { es };
er: { er };
elementRef: { er };
ers: { ers };
elementRefs: { ers };
v: { v };
value: { v }
aa: { aa: any };
anyAttribute: { aa: any };
ae: { ae: any };
anyElement: { ae: any };
a: { a: any };
attribute: { a: any };
em: { em: any };
elementMap: { em: any };
e: { e: any };
element: { e: any };
es: { es: any };
elements: { es: any };
er: { er: any };
elementRef: { er: any };
ers: { ers: any };
elementRefs: { ers: any };
v: { v: any };
value: { v: any }
}

}
}