Skip to content

Commit

Permalink
Added d.ts and v0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
w8r committed Oct 28, 2022
1 parent 750a209 commit 4c9da84
Show file tree
Hide file tree
Showing 6 changed files with 5,370 additions and 1,212 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org/
6 changes: 3 additions & 3 deletions example/js/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@
MaxScaleDenominator:b(t),ScaleHint:b(function(a,b){b=parseFloat(a.getAttribute("min"));a=parseFloat(a.getAttribute("max"));return {min:b,max:a}}),Layer:k(function(a,b){var c=b[b.length-1];b=l({},E,a,b);if(f(b)){var d=r(a.getAttribute("queryable"));f(d)||(d=c.queryable);b.queryable=f(d)?d:!1;d=v(a.getAttribute("cascaded"));f(d)||(d=c.cascaded);b.cascaded=d;d=r(a.getAttribute("opaque"));f(d)||(d=c.opaque);b.opaque=f(d)?d:!1;d=r(a.getAttribute("noSubsets"));f(d)||(d=c.noSubsets);b.noSubsets=f(d)?d:!1;
d=p(a.getAttribute("fixedWidth"));f(d)||(d=c.fixedWidth);b.fixedWidth=d;a=p(a.getAttribute("fixedHeight"));f(a)||(a=c.fixedHeight);b.fixedHeight=a;a=["Style","CRS","AuthorityURL"];d=0;for(var e=a.length;d<e;d++){var g=a[d],h=c[g];if(f(h)){var k=[];k=g in b?b[g]:b[g]=k;k=k.concat(h);b[g]=k;}}a="EX_GeographicBoundingBox BoundingBox Dimension Attribution MinScaleDenominator MaxScaleDenominator".split(" ");d=0;for(e=a.length;d<e;d++){ g=a[d],f(b[g])||(b[g]=c[g]); }return b}})}),T=h(g,{Title:b(e),OnlineResource:b(x),
LogoURL:b(C)}),S=h(g,{westBoundLongitude:b(t),eastBoundLongitude:b(t),southBoundLatitude:b(t),northBoundLatitude:b(t)}),N=h(g,{GetCapabilities:b(y),GetMap:b(y),GetFeatureInfo:b(y)}),I=h(g,{Format:k(e),DCPType:k(function(a,b){return l({},V,a,b)})}),V=h(g,{HTTP:b(function(a,b){return l({},W,a,b)})}),W=h(g,{Get:b(q),Post:b(q)}),U=h(g,{Name:b(e),Title:b(e),Abstract:b(e),LegendURL:k(C),StyleSheetURL:b(q),StyleURL:b(q)}),H=h(g,{Format:b(e),OnlineResource:b(x)}),J=h(g,{Keyword:A(e)});g=function(a,b){b||
"undefined"===typeof window||(b=window.DOMParser);this.version=void 0;this._parser=new z(b);this._data=a;};g.prototype.data=function(a){this._data=a;return this};g.prototype.toJSON=function(a){a=a||this._data;return this.parse(a)};g.prototype.parse=function(a){return this._readFromDocument(this._parser.toDocument(a))};g.prototype._readFromDocument=function(a){for(a=a.firstChild;a;a=a.nextSibling){ if(a.nodeType==u.ELEMENT){ return this.readFromNode(a); } }return null};g.prototype.readFromNode=function(a){this.version=
"undefined"===typeof window||(b=window.DOMParser);this.version=void 0;this._parser=new z(b);this._data=a;};g.prototype.data=function(a){this._data=a;return this};g.prototype.toJSON=function(a){a=a||this._data;return this.parse(a)};g.prototype.parse=function(a){return this.readFromDocument(this._parser.toDocument(a))};g.prototype.readFromDocument=function(a){for(a=a.firstChild;a;a=a.nextSibling){ if(a.nodeType==u.ELEMENT){ return this.readFromNode(a); } }return null};g.prototype.readFromNode=function(a){this.version=
a.getAttribute("version");return l({version:this.version},M,a,[])||null};return g});
//# sourceMappingURL=wms-capabilities.min.js.map

});

//import Spinner from 'spin.js';
Expand Down Expand Up @@ -194,4 +194,4 @@
}, 50);
}, false);

}());
})();
262 changes: 262 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,262 @@
export interface WMSCapabilitiesJSON {
version: string;
Service: Service;
Capability: Capability;
}

export interface Service {
Name: string;
Title: string;
Abstract: string;
KeywordList: string[];
OnlineResource: string;
ContactInformation: ContactInformation;
Fees: string;
AccessConstraints: string;
MaxWidth: number;
MaxHeight: number;
}

export interface ContactInformation {
ContactPersonPrimary: ContactPersonPrimary;
ContactPosition: string;
ContactAddress: ContactAddress;
ContactVoiceTelephone: string;
ContactFacsimileTelephone: string;
ContactElectronicMailAddress: string;
}

export interface ContactPersonPrimary {
ContactPerson: string;
ContactOrganization: string;
}

export interface ContactAddress {
AddressType: string;
Address: string;
City: string;
StateOrProvince: string;
PostCode: string;
Country: string;
}

export interface Capability {
Request: Request;
Exception: string[];
Layer: Layer;
}

export interface Request {
GetCapabilities: GetCapabilities;
GetMap: GetMap;
GetFeatureInfo: GetFeatureInfo;
}

export interface GetCapabilities {
Format: string[];
DCPType: Dcptype[];
}

export interface Dcptype {
HTTP: Http;
}

export interface Http {
Get: Get;
}

export interface Get {
OnlineResource: string;
}

export interface GetMap {
Format: string[];
DCPType: Dcptype2[];
}

export interface Dcptype2 {
HTTP: Http2;
}

export interface Http2 {
Get: Get2;
}

export interface Get2 {
OnlineResource: string;
}

export interface GetFeatureInfo {
Format: string[];
DCPType: Dcptype3[];
}

export interface Dcptype3 {
HTTP: Http3;
}

export interface Http3 {
Get: Get3;
}

export interface Get3 {
OnlineResource: string;
}

export interface Layer {
queryable: boolean;
Title: string;
CRS: string[];
EX_GeographicBoundingBox: number[];
BoundingBox: BoundingBox[];
Layer: Layer2[];
}

export interface BoundingBox {
crs: string;
extent: number[];
res: any[];
}

export interface Layer2 {
Title: string;
Abstract: string;
CRS: string[];
EX_GeographicBoundingBox: number[];
BoundingBox: BoundingBox2[];
Dimension: Dimension[];
Layer: Layer3[];
queryable: boolean;
opaque: boolean;
noSubsets: boolean;
}

export interface BoundingBox2 {
crs: string;
extent: number[];
res: any[];
}

export interface Dimension {
name: string;
units: string;
unitSymbol: any;
default: any;
current: boolean;
values: string;
}

export interface Layer3 {
Name: string;
Title: string;
Abstract: string;
CRS: string[];
EX_GeographicBoundingBox: number[];
BoundingBox: BoundingBox3[];
Style: Style[];
queryable: boolean;
opaque: boolean;
noSubsets: boolean;
Dimension: Dimension2[];
}

export interface BoundingBox3 {
crs: string;
extent: number[];
res: any[];
}

export interface Style {
Name: string;
Title: string;
LegendURL: LegendUrl[];
}

export interface LegendUrl {
Format: string;
OnlineResource: string;
size: number[];
}

export interface Dimension2 {
name: string;
units: string;
unitSymbol: any;
default: any;
current: boolean;
values: string;
}

export default class WMS {
/**
* WMS Capabilities parser
*
* @param {String=} xmlString
* @constructor
*/
constructor(xmlString?: string | undefined, DOMParser: any);
/**
* @type {String}
*/
version: string;
/**
* @type {XMLParser}
*/
_parser: XMLParser;
/**
* @type {String=}
*/
_data: string | undefined;
/**
* @param {String} xmlString
* @return {WMS}
*/
data(xmlString: string): WMS;
/**
* @param {String=} xmlString
* @return {Object|null}
*/
toJSON(xmlString?: string | undefined): WMSCapabilitiesJSON | null;
/**
* @return {String} xml
* @return {Object|null}
*/
parse(xmlString: any): WMSCapabilitiesJSON;
/**
* @param {Document} doc
* @return {Object|null}
*/
readFromDocument(doc: Document): WMSCapabilitiesJSON | null;
/**
* @param {DOMNode} node
* @return {Object}
*/
readFromNode(node: DOMNode): WMSCapabilitiesJSON;
}

class XMLParser {
/**
* XML DOM parser
* @constructor
* @param {DOMParser} DOMParser
*/
constructor(DOMParser: DOMParser);
/**
* @type {DOMParser}
*/
_parser: DOMParser;
/**
* @param {String} xmlstring
* @return {Document}
*/
toDocument(xmlstring: string): Document;
/**
* Recursively grab all text content of child nodes into a single string.
* @param {Node} node Node.
* @param {boolean} normalizeWhitespace Normalize whitespace: remove all line
* breaks.
* @return {string} All text content.
* @api
*/
getAllTextContent(node: Node, normalizeWhitespace: boolean): string;
}
Loading

0 comments on commit 4c9da84

Please sign in to comment.