wechat-mini-program-extend
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -52,2 +52,11 @@ declare namespace extend { | ||
onHide?: () => void; | ||
computed?: object; | ||
watch?: object; | ||
beforeCreate?: () => void; | ||
beforeMount?: () => void; | ||
mounted?: () => void; | ||
beforeDestroy?: () => void; | ||
destroyed?: () => void; | ||
provide?: () => object; | ||
inject?: () => object; | ||
} | ||
@@ -82,2 +91,70 @@ | ||
} | ||
interface MPExtender { | ||
use<T extends OptionInstaller>(installer: T): void; | ||
extends(options: object): object; | ||
} | ||
interface FrameworkInstaller { | ||
configuration(extender: MPExtender, context: Map<any, any>, options: object): object; | ||
install(extender: MPExtender, context: Map<any, any>, options: object): object; | ||
build(extender: MPExtender, context: Map<any, any>, options: object): object; | ||
} | ||
interface BehaviorInstaller extends FrameworkInstaller { | ||
definitionFilter(extender: MPExtender, context: Map<any, any>, options: object, defFields: object, definitionFilterArr: ((defFields: object, definitionFilterArr?: object[]) => void)[]); | ||
behaviors(): string[]; | ||
properties(): { [key: string]: PropOption }; | ||
observers(): { [key: string]: (...newValues: any[]) => void }; | ||
data(): (() => object) | object; | ||
methods(): { [key: string]: (...args: any[]) => any }; | ||
ready(): void; | ||
moved(): void; | ||
options(): object; | ||
lifetimes(extender, context, options): Lifetimes; | ||
pageLifetimes(extender, context, options): PageLifetimes; | ||
externalClasses(): string[]; | ||
relations(): ComponentRelation; | ||
} | ||
interface OptionInstaller extends BehaviorInstaller { | ||
computed(): object; | ||
watch(): object; | ||
beforeCreate(): void; | ||
created(): void; | ||
beforeMount(): void; | ||
mounted(): void; | ||
beforeUpdate(extender: MPExtender, context: Map<any, any>, options: object, runtimeContext: object, data: object): void; | ||
updated(extender: MPExtender, context: Map<any, any>, options: object, runtimeContext: object, data: object): void; | ||
beforeDestroy(): void; | ||
destroyed(): void; | ||
provide(): object; | ||
inject(): object; | ||
} | ||
} | ||
@@ -87,2 +164,12 @@ | ||
export declare function ComponentEx<T extends extend.ComponentExOptions & object>(options: T): void; | ||
export declare function ComponentEx<T extends extend.ComponentExOptions & object>(options: T): void; | ||
export const Extension: { | ||
use: <T extends extend.OptionInstaller>(installer: T) => void; | ||
}; | ||
export declare interface MPExtender extends extend.MPExtender { | ||
} | ||
export declare interface OptionInstaller extends extend.OptionInstaller { | ||
} |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ComponentEx=ComponentEx,exports.Extension=void 0,exports.PageEx=PageEx;var _MPExtender=_interopRequireDefault(require("./core/MPExtender"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _slicedToArray(e,r){return _arrayWithHoles(e)||_iterableToArrayLimit(e,r)||_unsupportedIterableToArray(e,r)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,l=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==t.return||t.return()}finally{if(l)throw o}}return a}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _createForOfIteratorHelper(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=_unsupportedIterableToArray(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){i=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(i)throw o}}}}function _unsupportedIterableToArray(e,r){if(e){if("string"==typeof e)return _arrayLikeToArray(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(t="Object"===t&&e.constructor?e.constructor.name:t)||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,r):void 0}}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var Extension={_installerClasses:new Map,use:function(e){this._installerClasses.set(e,1<arguments.length&&void 0!==arguments[1]?arguments[1]:100)}};function PageEx(e){var r=new _MPExtender.default;if(Extension._installerClasses.size){var t,n=_createForOfIteratorHelper(Extension._installerClasses);try{for(n.s();!(t=n.n()).done;){var o=_slicedToArray(t.value,2),a=o[0],i=o[1];r.use(new a,i)}}catch(e){n.e(e)}finally{n.f()}}Page(r.extends(e))}function ComponentEx(e){var r=new _MPExtender.default;if(Extension._installerClasses.size){var t,n=_createForOfIteratorHelper(Extension._installerClasses);try{for(n.s();!(t=n.n()).done;){var o=_slicedToArray(t.value,2),a=o[0],i=o[1];r.use(new a,i)}}catch(e){n.e(e)}finally{n.f()}}Component(r.extends(e))}exports.Extension=Extension; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ComponentEx=ComponentEx,exports.OptionInstaller=exports.MPExtender=exports.Extension=void 0,exports.PageEx=PageEx;var _MPExtender2=_interopRequireDefault(require("./core/MPExtender")),_OptionInstaller2=_interopRequireDefault(require("./core/OptionInstaller"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _slicedToArray(e,r){return _arrayWithHoles(e)||_iterableToArrayLimit(e,r)||_unsupportedIterableToArray(e,r)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],l=!0,i=!1;try{for(t=t.call(e);!(l=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);l=!0);}catch(e){i=!0,o=e}finally{try{l||null==t.return||t.return()}finally{if(i)throw o}}return a}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _createForOfIteratorHelper(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=_unsupportedIterableToArray(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw o}}}}function _unsupportedIterableToArray(e,r){if(e){if("string"==typeof e)return _arrayLikeToArray(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(t="Object"===t&&e.constructor?e.constructor.name:t)||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,r):void 0}}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var Extension={_installerClasses:new Map,use:function(e){this._installerClasses.set(e,1<arguments.length&&void 0!==arguments[1]?arguments[1]:100)}};function PageEx(e){var r=new _MPExtender2.default;if(Extension._installerClasses.size){var t,n=_createForOfIteratorHelper(Extension._installerClasses);try{for(n.s();!(t=n.n()).done;){var o=_slicedToArray(t.value,2),a=o[0],l=o[1];r.use(new a,l)}}catch(e){n.e(e)}finally{n.f()}}Page(r.extends(e))}function ComponentEx(e){var r=new _MPExtender2.default;if(Extension._installerClasses.size){var t,n=_createForOfIteratorHelper(Extension._installerClasses);try{for(n.s();!(t=n.n()).done;){var o=_slicedToArray(t.value,2),a=o[0],l=o[1];r.use(new a,l)}}catch(e){n.e(e)}finally{n.f()}}Component(r.extends(e))}exports.Extension=Extension;var MPExtender=_MPExtender2.default;exports.MPExtender=MPExtender;var OptionInstaller=_OptionInstaller2.default;exports.OptionInstaller=OptionInstaller; |
@@ -52,2 +52,11 @@ declare namespace extend { | ||
onHide?: () => void; | ||
computed?: object; | ||
watch?: object; | ||
beforeCreate?: () => void; | ||
beforeMount?: () => void; | ||
mounted?: () => void; | ||
beforeDestroy?: () => void; | ||
destroyed?: () => void; | ||
provide?: () => object; | ||
inject?: () => object; | ||
} | ||
@@ -82,2 +91,70 @@ | ||
} | ||
interface MPExtender { | ||
use<T extends OptionInstaller>(installer: T): void; | ||
extends(options: object): object; | ||
} | ||
interface FrameworkInstaller { | ||
configuration(extender: MPExtender, context: Map<any, any>, options: object): object; | ||
install(extender: MPExtender, context: Map<any, any>, options: object): object; | ||
build(extender: MPExtender, context: Map<any, any>, options: object): object; | ||
} | ||
interface BehaviorInstaller extends FrameworkInstaller { | ||
definitionFilter(extender: MPExtender, context: Map<any, any>, options: object, defFields: object, definitionFilterArr: ((defFields: object, definitionFilterArr?: object[]) => void)[]); | ||
behaviors(): string[]; | ||
properties(): { [key: string]: PropOption }; | ||
observers(): { [key: string]: (...newValues: any[]) => void }; | ||
data(): (() => object) | object; | ||
methods(): { [key: string]: (...args: any[]) => any }; | ||
ready(): void; | ||
moved(): void; | ||
options(): object; | ||
lifetimes(extender, context, options): Lifetimes; | ||
pageLifetimes(extender, context, options): PageLifetimes; | ||
externalClasses(): string[]; | ||
relations(): ComponentRelation; | ||
} | ||
interface OptionInstaller extends BehaviorInstaller { | ||
computed(): object; | ||
watch(): object; | ||
beforeCreate(): void; | ||
created(): void; | ||
beforeMount(): void; | ||
mounted(): void; | ||
beforeUpdate(extender: MPExtender, context: Map<any, any>, options: object, runtimeContext: object, data: object): void; | ||
updated(extender: MPExtender, context: Map<any, any>, options: object, runtimeContext: object, data: object): void; | ||
beforeDestroy(): void; | ||
destroyed(): void; | ||
provide(): object; | ||
inject(): object; | ||
} | ||
} | ||
@@ -87,2 +164,12 @@ | ||
export declare function ComponentEx<T extends extend.ComponentExOptions & object>(options: T): void; | ||
export declare function ComponentEx<T extends extend.ComponentExOptions & object>(options: T): void; | ||
export const Extension: { | ||
use: <T extends extend.OptionInstaller>(installer: T) => void; | ||
}; | ||
export declare interface MPExtender extends extend.MPExtender { | ||
} | ||
export declare interface OptionInstaller extends extend.OptionInstaller { | ||
} |
{ | ||
"name": "wechat-mini-program-extend", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"repository": "git@github.com:sitorhy/wechat-mini-program-extend.git", | ||
@@ -5,0 +5,0 @@ "author": "sitorhy <sitorhy>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
165330
41
283