JS stdlib: added some JSDoc annotations to handwritten js files.
This commit is contained in:
@@ -124,12 +124,24 @@ var Kotlin = {};
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* @this {{object_initializer$: (function(): Object)}}
|
||||
* @returns {Object}
|
||||
*/
|
||||
function class_object() {
|
||||
var object = this.object_initializer$();
|
||||
Object.defineProperty(this, "object", {value: object});
|
||||
return object;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {(Array|Object|null)=} bases
|
||||
* @param {(function(new: T, ?, ?, ?, ?, ?, ?, ?): T)|null=} constructor
|
||||
* @param {Object=} properties
|
||||
* @param {Object=} staticProperties
|
||||
* @returns {function(new: T): T}
|
||||
* @template T
|
||||
*/
|
||||
Kotlin.createClassNow = function (bases, constructor, properties, staticProperties) {
|
||||
if (constructor == null) {
|
||||
constructor = emptyFunction();
|
||||
@@ -192,6 +204,13 @@ var Kotlin = {};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {(function():Array.<*>)|null} basesFun
|
||||
* @param {?=} constructor
|
||||
* @param {Object=} properties
|
||||
* @param {Object=} staticProperties
|
||||
* @returns {*}
|
||||
*/
|
||||
Kotlin.createClass = function (basesFun, constructor, properties, staticProperties) {
|
||||
function $o() {
|
||||
var klass = Kotlin.createClassNow(getBases(basesFun), constructor, properties, staticProperties);
|
||||
@@ -203,6 +222,12 @@ var Kotlin = {};
|
||||
return $o;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {(function():Array.<*>)|null} basesFun
|
||||
* @param {Object=} properties
|
||||
* @param {Object=} staticProperties
|
||||
* @returns {*}
|
||||
*/
|
||||
Kotlin.createTrait = function (basesFun, properties, staticProperties) {
|
||||
function $o() {
|
||||
var klass = Kotlin.createTraitNow(getBases(basesFun), properties, staticProperties);
|
||||
@@ -214,6 +239,13 @@ var Kotlin = {};
|
||||
return $o;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {function()|null} basesFun
|
||||
* @param {(function(new: T): T)|null=} constructor
|
||||
* @param {Object=} functions
|
||||
* @returns {Object}
|
||||
* @template T
|
||||
*/
|
||||
Kotlin.createObject = function (basesFun, constructor, functions) {
|
||||
return Kotlin.createObjectNow(getBases(basesFun), constructor, functions);
|
||||
};
|
||||
@@ -306,6 +338,11 @@ var Kotlin = {};
|
||||
return definition;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {function()|null=} initializer
|
||||
* @param {Object=} members
|
||||
* @returns {Object}
|
||||
*/
|
||||
Kotlin.definePackage = function (initializer, members) {
|
||||
var definition = createDefinition(members);
|
||||
if (initializer === null) {
|
||||
@@ -329,6 +366,10 @@ var Kotlin = {};
|
||||
return definition;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} id
|
||||
* @param {Object} declaration
|
||||
*/
|
||||
Kotlin.defineModule = function (id, declaration) {
|
||||
if (id in Kotlin.modules) {
|
||||
throw new Error("Module " + id + " is already defined");
|
||||
|
||||
Reference in New Issue
Block a user