Created
January 16, 2014 21:42
-
-
Save dasa/8463986 to your computer and use it in GitHub Desktop.
Dojo TypeScript extension test. Output js files compiled using: tsc -m amd test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module "dijit/layout/ContentPane" { | |
class ContentPane { | |
// define methods etc. here | |
} | |
export = ContentPane; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path="./dojo-test"/> | |
var __extends = this.__extends || function (d, b) { | |
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | |
function __() { this.constructor = d; } | |
__.prototype = b.prototype; | |
d.prototype = new __(); | |
}; | |
define(["require", "exports", "dijit/layout/ContentPane"], function(require, exports, ContentPane) { | |
var LayerStylePane = (function (_super) { | |
__extends(LayerStylePane, _super); | |
function LayerStylePane() { | |
_super.apply(this, arguments); | |
} | |
LayerStylePane.prototype.addSymbol = function (label, symbol) { | |
// impl here | |
}; | |
return LayerStylePane; | |
})(ContentPane); | |
return LayerStylePane; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path="./dojo-test"/> | |
import ContentPane = require("dijit/layout/ContentPane"); | |
export = LayerStylePane; | |
class LayerStylePane extends ContentPane { | |
addSymbol(label: string, symbol: any) { | |
// impl here | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(["require", "exports", "./LayerStylePane"], function(require, exports, LayerStylePane) { | |
var myPane = new LayerStylePane(); | |
myPane.addSymbol("test", {}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import LayerStylePane = require("./LayerStylePane"); | |
var myPane = new LayerStylePane(); | |
myPane.addSymbol("test", {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use
extends
under 0.9.5, you'd need the style:The style I use won't allow it:
But there are a lot of places to change.