mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 04:14:21 +08:00
docs(optional): add syntax to flag params as optional
This commit is contained in:
@ -24,6 +24,7 @@ module.exports = function(currentVersion, initialVersionBuild) {
|
|||||||
.processor(require('./processors/hide-private-api'))
|
.processor(require('./processors/hide-private-api'))
|
||||||
.processor(require('./processors/collect-inputs-outputs'))
|
.processor(require('./processors/collect-inputs-outputs'))
|
||||||
.processor(require('./processors/parse-returns-object'))
|
.processor(require('./processors/parse-returns-object'))
|
||||||
|
.processor(require('./processors/parse-optional'))
|
||||||
|
|
||||||
// for debugging docs
|
// for debugging docs
|
||||||
// .processor(function test(){
|
// .processor(function test(){
|
||||||
|
21
scripts/docs/processors/parse-optional.js
Normal file
21
scripts/docs/processors/parse-optional.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
module.exports = function parseOptional() {
|
||||||
|
return {
|
||||||
|
$runBefore: ['rendering-docs'],
|
||||||
|
$process: function(docs) {
|
||||||
|
docs.forEach(function(doc) {
|
||||||
|
if(doc.members && doc.members.length) {
|
||||||
|
for (var i in doc.members) {
|
||||||
|
if(doc.members[i].params && doc.members[i].params.length) {
|
||||||
|
for (var ii in doc.members[i].params) {
|
||||||
|
if(doc.members[i].params[ii].optional){
|
||||||
|
doc.members[i].params[ii].description += '<strong class="tag">Optional</strong>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return docs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
@ -743,8 +743,8 @@ export class Slides extends Ion {
|
|||||||
* Transition to the specified slide.
|
* Transition to the specified slide.
|
||||||
*
|
*
|
||||||
* @param {number} index The index number of the slide.
|
* @param {number} index The index number of the slide.
|
||||||
* @param {number} speed Transition duration (in ms). Optional.
|
* @param {number} [speed] Transition duration (in ms).
|
||||||
* @param {boolean} runCallbacks Whether or not to emit the `ionWillChange`/`ionDidChange` events. Optional. Default true.
|
* @param {boolean} [runCallbacks] Whether or not to emit the `ionWillChange`/`ionDidChange` events. Default true.
|
||||||
*/
|
*/
|
||||||
slideTo(index: number, speed?: number, runCallbacks?: boolean) {
|
slideTo(index: number, speed?: number, runCallbacks?: boolean) {
|
||||||
this.slider.slideTo(index, speed, runCallbacks);
|
this.slider.slideTo(index, speed, runCallbacks);
|
||||||
@ -753,8 +753,8 @@ export class Slides extends Ion {
|
|||||||
/**
|
/**
|
||||||
* Transition to the next slide.
|
* Transition to the next slide.
|
||||||
*
|
*
|
||||||
* @param {number} speed Transition duration (in ms). Optional.
|
* @param {number} [speed] Transition duration (in ms).
|
||||||
* @param {boolean} runCallbacks Whether or not to emit the `ionWillChange`/`ionDidChange` events. Optional. Default true.
|
* @param {boolean} [runCallbacks] Whether or not to emit the `ionWillChange`/`ionDidChange` events. Default true.
|
||||||
*/
|
*/
|
||||||
slideNext(speed?: number, runCallbacks?: boolean) {
|
slideNext(speed?: number, runCallbacks?: boolean) {
|
||||||
this.slider.slideNext(runCallbacks, speed);
|
this.slider.slideNext(runCallbacks, speed);
|
||||||
@ -763,8 +763,8 @@ export class Slides extends Ion {
|
|||||||
/**
|
/**
|
||||||
* Transition to the previous slide.
|
* Transition to the previous slide.
|
||||||
*
|
*
|
||||||
* @param {number} speed Transition duration (in ms). Optional.
|
* @param {number} [speed] Transition duration (in ms).
|
||||||
* @param {boolean} runCallbacks Whether or not to emit the `ionWillChange`/`ionDidChange` events. Optional. Default true.
|
* @param {boolean} [runCallbacks] Whether or not to emit the `ionWillChange`/`ionDidChange` events. Default true.
|
||||||
*/
|
*/
|
||||||
slidePrev(speed?: number, runCallbacks?: boolean) {
|
slidePrev(speed?: number, runCallbacks?: boolean) {
|
||||||
this.slider.slidePrev(runCallbacks, speed);
|
this.slider.slidePrev(runCallbacks, speed);
|
||||||
|
Reference in New Issue
Block a user