How to use runtime method in wpt

Best JavaScript code snippet using wpt

runtime_vx.x.x.js

Source:runtime_vx.x.x.js Github

copy

Full Screen

1// flow-typed signature: fd07c2d2705620ac687c7a1213b5e8b52// flow-typed version: <<STUB>>/@babel/runtime_v^7.5.5/flow_v0.104.03/**4 * This is an autogenerated libdef stub for:5 *6 * '@babel/runtime'7 *8 * Fill this stub out by replacing all the `any` types.9 *10 * Once filled out, we encourage you to share your work with the11 * community by sending a pull request to:12 * https://github.com/flowtype/flow-typed13 */14declare module '@babel/runtime' {15 declare module.exports: any;16}17/**18 * We include stubs for each file inside this npm package in case you need to19 * require those files directly. Feel free to delete any files that aren't20 * needed.21 */22declare module '@babel/runtime/helpers/applyDecoratedDescriptor' {23 declare module.exports: any;24}25declare module '@babel/runtime/helpers/arrayWithHoles' {26 declare module.exports: any;27}28declare module '@babel/runtime/helpers/arrayWithoutHoles' {29 declare module.exports: any;30}31declare module '@babel/runtime/helpers/assertThisInitialized' {32 declare module.exports: any;33}34declare module '@babel/runtime/helpers/AsyncGenerator' {35 declare module.exports: any;36}37declare module '@babel/runtime/helpers/asyncGeneratorDelegate' {38 declare module.exports: any;39}40declare module '@babel/runtime/helpers/asyncIterator' {41 declare module.exports: any;42}43declare module '@babel/runtime/helpers/asyncToGenerator' {44 declare module.exports: any;45}46declare module '@babel/runtime/helpers/awaitAsyncGenerator' {47 declare module.exports: any;48}49declare module '@babel/runtime/helpers/AwaitValue' {50 declare module.exports: any;51}52declare module '@babel/runtime/helpers/classCallCheck' {53 declare module.exports: any;54}55declare module '@babel/runtime/helpers/classNameTDZError' {56 declare module.exports: any;57}58declare module '@babel/runtime/helpers/classPrivateFieldDestructureSet' {59 declare module.exports: any;60}61declare module '@babel/runtime/helpers/classPrivateFieldGet' {62 declare module.exports: any;63}64declare module '@babel/runtime/helpers/classPrivateFieldLooseBase' {65 declare module.exports: any;66}67declare module '@babel/runtime/helpers/classPrivateFieldLooseKey' {68 declare module.exports: any;69}70declare module '@babel/runtime/helpers/classPrivateFieldSet' {71 declare module.exports: any;72}73declare module '@babel/runtime/helpers/classPrivateMethodGet' {74 declare module.exports: any;75}76declare module '@babel/runtime/helpers/classPrivateMethodSet' {77 declare module.exports: any;78}79declare module '@babel/runtime/helpers/classStaticPrivateFieldSpecGet' {80 declare module.exports: any;81}82declare module '@babel/runtime/helpers/classStaticPrivateFieldSpecSet' {83 declare module.exports: any;84}85declare module '@babel/runtime/helpers/classStaticPrivateMethodGet' {86 declare module.exports: any;87}88declare module '@babel/runtime/helpers/classStaticPrivateMethodSet' {89 declare module.exports: any;90}91declare module '@babel/runtime/helpers/construct' {92 declare module.exports: any;93}94declare module '@babel/runtime/helpers/createClass' {95 declare module.exports: any;96}97declare module '@babel/runtime/helpers/decorate' {98 declare module.exports: any;99}100declare module '@babel/runtime/helpers/defaults' {101 declare module.exports: any;102}103declare module '@babel/runtime/helpers/defineEnumerableProperties' {104 declare module.exports: any;105}106declare module '@babel/runtime/helpers/defineProperty' {107 declare module.exports: any;108}109declare module '@babel/runtime/helpers/esm/applyDecoratedDescriptor' {110 declare module.exports: any;111}112declare module '@babel/runtime/helpers/esm/arrayWithHoles' {113 declare module.exports: any;114}115declare module '@babel/runtime/helpers/esm/arrayWithoutHoles' {116 declare module.exports: any;117}118declare module '@babel/runtime/helpers/esm/assertThisInitialized' {119 declare module.exports: any;120}121declare module '@babel/runtime/helpers/esm/AsyncGenerator' {122 declare module.exports: any;123}124declare module '@babel/runtime/helpers/esm/asyncGeneratorDelegate' {125 declare module.exports: any;126}127declare module '@babel/runtime/helpers/esm/asyncIterator' {128 declare module.exports: any;129}130declare module '@babel/runtime/helpers/esm/asyncToGenerator' {131 declare module.exports: any;132}133declare module '@babel/runtime/helpers/esm/awaitAsyncGenerator' {134 declare module.exports: any;135}136declare module '@babel/runtime/helpers/esm/AwaitValue' {137 declare module.exports: any;138}139declare module '@babel/runtime/helpers/esm/classCallCheck' {140 declare module.exports: any;141}142declare module '@babel/runtime/helpers/esm/classNameTDZError' {143 declare module.exports: any;144}145declare module '@babel/runtime/helpers/esm/classPrivateFieldDestructureSet' {146 declare module.exports: any;147}148declare module '@babel/runtime/helpers/esm/classPrivateFieldGet' {149 declare module.exports: any;150}151declare module '@babel/runtime/helpers/esm/classPrivateFieldLooseBase' {152 declare module.exports: any;153}154declare module '@babel/runtime/helpers/esm/classPrivateFieldLooseKey' {155 declare module.exports: any;156}157declare module '@babel/runtime/helpers/esm/classPrivateFieldSet' {158 declare module.exports: any;159}160declare module '@babel/runtime/helpers/esm/classPrivateMethodGet' {161 declare module.exports: any;162}163declare module '@babel/runtime/helpers/esm/classPrivateMethodSet' {164 declare module.exports: any;165}166declare module '@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet' {167 declare module.exports: any;168}169declare module '@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet' {170 declare module.exports: any;171}172declare module '@babel/runtime/helpers/esm/classStaticPrivateMethodGet' {173 declare module.exports: any;174}175declare module '@babel/runtime/helpers/esm/classStaticPrivateMethodSet' {176 declare module.exports: any;177}178declare module '@babel/runtime/helpers/esm/construct' {179 declare module.exports: any;180}181declare module '@babel/runtime/helpers/esm/createClass' {182 declare module.exports: any;183}184declare module '@babel/runtime/helpers/esm/decorate' {185 declare module.exports: any;186}187declare module '@babel/runtime/helpers/esm/defaults' {188 declare module.exports: any;189}190declare module '@babel/runtime/helpers/esm/defineEnumerableProperties' {191 declare module.exports: any;192}193declare module '@babel/runtime/helpers/esm/defineProperty' {194 declare module.exports: any;195}196declare module '@babel/runtime/helpers/esm/extends' {197 declare module.exports: any;198}199declare module '@babel/runtime/helpers/esm/get' {200 declare module.exports: any;201}202declare module '@babel/runtime/helpers/esm/getPrototypeOf' {203 declare module.exports: any;204}205declare module '@babel/runtime/helpers/esm/inherits' {206 declare module.exports: any;207}208declare module '@babel/runtime/helpers/esm/inheritsLoose' {209 declare module.exports: any;210}211declare module '@babel/runtime/helpers/esm/initializerDefineProperty' {212 declare module.exports: any;213}214declare module '@babel/runtime/helpers/esm/initializerWarningHelper' {215 declare module.exports: any;216}217declare module '@babel/runtime/helpers/esm/instanceof' {218 declare module.exports: any;219}220declare module '@babel/runtime/helpers/esm/interopRequireDefault' {221 declare module.exports: any;222}223declare module '@babel/runtime/helpers/esm/interopRequireWildcard' {224 declare module.exports: any;225}226declare module '@babel/runtime/helpers/esm/isNativeFunction' {227 declare module.exports: any;228}229declare module '@babel/runtime/helpers/esm/iterableToArray' {230 declare module.exports: any;231}232declare module '@babel/runtime/helpers/esm/iterableToArrayLimit' {233 declare module.exports: any;234}235declare module '@babel/runtime/helpers/esm/iterableToArrayLimitLoose' {236 declare module.exports: any;237}238declare module '@babel/runtime/helpers/esm/jsx' {239 declare module.exports: any;240}241declare module '@babel/runtime/helpers/esm/newArrowCheck' {242 declare module.exports: any;243}244declare module '@babel/runtime/helpers/esm/nonIterableRest' {245 declare module.exports: any;246}247declare module '@babel/runtime/helpers/esm/nonIterableSpread' {248 declare module.exports: any;249}250declare module '@babel/runtime/helpers/esm/objectDestructuringEmpty' {251 declare module.exports: any;252}253declare module '@babel/runtime/helpers/esm/objectSpread' {254 declare module.exports: any;255}256declare module '@babel/runtime/helpers/esm/objectSpread2' {257 declare module.exports: any;258}259declare module '@babel/runtime/helpers/esm/objectWithoutProperties' {260 declare module.exports: any;261}262declare module '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose' {263 declare module.exports: any;264}265declare module '@babel/runtime/helpers/esm/possibleConstructorReturn' {266 declare module.exports: any;267}268declare module '@babel/runtime/helpers/esm/readOnlyError' {269 declare module.exports: any;270}271declare module '@babel/runtime/helpers/esm/set' {272 declare module.exports: any;273}274declare module '@babel/runtime/helpers/esm/setPrototypeOf' {275 declare module.exports: any;276}277declare module '@babel/runtime/helpers/esm/skipFirstGeneratorNext' {278 declare module.exports: any;279}280declare module '@babel/runtime/helpers/esm/slicedToArray' {281 declare module.exports: any;282}283declare module '@babel/runtime/helpers/esm/slicedToArrayLoose' {284 declare module.exports: any;285}286declare module '@babel/runtime/helpers/esm/superPropBase' {287 declare module.exports: any;288}289declare module '@babel/runtime/helpers/esm/taggedTemplateLiteral' {290 declare module.exports: any;291}292declare module '@babel/runtime/helpers/esm/taggedTemplateLiteralLoose' {293 declare module.exports: any;294}295declare module '@babel/runtime/helpers/esm/temporalRef' {296 declare module.exports: any;297}298declare module '@babel/runtime/helpers/esm/temporalUndefined' {299 declare module.exports: any;300}301declare module '@babel/runtime/helpers/esm/toArray' {302 declare module.exports: any;303}304declare module '@babel/runtime/helpers/esm/toConsumableArray' {305 declare module.exports: any;306}307declare module '@babel/runtime/helpers/esm/toPrimitive' {308 declare module.exports: any;309}310declare module '@babel/runtime/helpers/esm/toPropertyKey' {311 declare module.exports: any;312}313declare module '@babel/runtime/helpers/esm/typeof' {314 declare module.exports: any;315}316declare module '@babel/runtime/helpers/esm/wrapAsyncGenerator' {317 declare module.exports: any;318}319declare module '@babel/runtime/helpers/esm/wrapNativeSuper' {320 declare module.exports: any;321}322declare module '@babel/runtime/helpers/esm/wrapRegExp' {323 declare module.exports: any;324}325declare module '@babel/runtime/helpers/extends' {326 declare module.exports: any;327}328declare module '@babel/runtime/helpers/get' {329 declare module.exports: any;330}331declare module '@babel/runtime/helpers/getPrototypeOf' {332 declare module.exports: any;333}334declare module '@babel/runtime/helpers/inherits' {335 declare module.exports: any;336}337declare module '@babel/runtime/helpers/inheritsLoose' {338 declare module.exports: any;339}340declare module '@babel/runtime/helpers/initializerDefineProperty' {341 declare module.exports: any;342}343declare module '@babel/runtime/helpers/initializerWarningHelper' {344 declare module.exports: any;345}346declare module '@babel/runtime/helpers/instanceof' {347 declare module.exports: any;348}349declare module '@babel/runtime/helpers/interopRequireDefault' {350 declare module.exports: any;351}352declare module '@babel/runtime/helpers/interopRequireWildcard' {353 declare module.exports: any;354}355declare module '@babel/runtime/helpers/isNativeFunction' {356 declare module.exports: any;357}358declare module '@babel/runtime/helpers/iterableToArray' {359 declare module.exports: any;360}361declare module '@babel/runtime/helpers/iterableToArrayLimit' {362 declare module.exports: any;363}364declare module '@babel/runtime/helpers/iterableToArrayLimitLoose' {365 declare module.exports: any;366}367declare module '@babel/runtime/helpers/jsx' {368 declare module.exports: any;369}370declare module '@babel/runtime/helpers/newArrowCheck' {371 declare module.exports: any;372}373declare module '@babel/runtime/helpers/nonIterableRest' {374 declare module.exports: any;375}376declare module '@babel/runtime/helpers/nonIterableSpread' {377 declare module.exports: any;378}379declare module '@babel/runtime/helpers/objectDestructuringEmpty' {380 declare module.exports: any;381}382declare module '@babel/runtime/helpers/objectSpread' {383 declare module.exports: any;384}385declare module '@babel/runtime/helpers/objectSpread2' {386 declare module.exports: any;387}388declare module '@babel/runtime/helpers/objectWithoutProperties' {389 declare module.exports: any;390}391declare module '@babel/runtime/helpers/objectWithoutPropertiesLoose' {392 declare module.exports: any;393}394declare module '@babel/runtime/helpers/possibleConstructorReturn' {395 declare module.exports: any;396}397declare module '@babel/runtime/helpers/readOnlyError' {398 declare module.exports: any;399}400declare module '@babel/runtime/helpers/set' {401 declare module.exports: any;402}403declare module '@babel/runtime/helpers/setPrototypeOf' {404 declare module.exports: any;405}406declare module '@babel/runtime/helpers/skipFirstGeneratorNext' {407 declare module.exports: any;408}409declare module '@babel/runtime/helpers/slicedToArray' {410 declare module.exports: any;411}412declare module '@babel/runtime/helpers/slicedToArrayLoose' {413 declare module.exports: any;414}415declare module '@babel/runtime/helpers/superPropBase' {416 declare module.exports: any;417}418declare module '@babel/runtime/helpers/taggedTemplateLiteral' {419 declare module.exports: any;420}421declare module '@babel/runtime/helpers/taggedTemplateLiteralLoose' {422 declare module.exports: any;423}424declare module '@babel/runtime/helpers/temporalRef' {425 declare module.exports: any;426}427declare module '@babel/runtime/helpers/temporalUndefined' {428 declare module.exports: any;429}430declare module '@babel/runtime/helpers/toArray' {431 declare module.exports: any;432}433declare module '@babel/runtime/helpers/toConsumableArray' {434 declare module.exports: any;435}436declare module '@babel/runtime/helpers/toPrimitive' {437 declare module.exports: any;438}439declare module '@babel/runtime/helpers/toPropertyKey' {440 declare module.exports: any;441}442declare module '@babel/runtime/helpers/typeof' {443 declare module.exports: any;444}445declare module '@babel/runtime/helpers/wrapAsyncGenerator' {446 declare module.exports: any;447}448declare module '@babel/runtime/helpers/wrapNativeSuper' {449 declare module.exports: any;450}451declare module '@babel/runtime/helpers/wrapRegExp' {452 declare module.exports: any;453}454declare module '@babel/runtime/regenerator' {455 declare module.exports: any;456}457// Filename aliases458declare module '@babel/runtime/helpers/applyDecoratedDescriptor.js' {459 declare module.exports: $Exports<'@babel/runtime/helpers/applyDecoratedDescriptor'>;460}461declare module '@babel/runtime/helpers/arrayWithHoles.js' {462 declare module.exports: $Exports<'@babel/runtime/helpers/arrayWithHoles'>;463}464declare module '@babel/runtime/helpers/arrayWithoutHoles.js' {465 declare module.exports: $Exports<'@babel/runtime/helpers/arrayWithoutHoles'>;466}467declare module '@babel/runtime/helpers/assertThisInitialized.js' {468 declare module.exports: $Exports<'@babel/runtime/helpers/assertThisInitialized'>;469}470declare module '@babel/runtime/helpers/AsyncGenerator.js' {471 declare module.exports: $Exports<'@babel/runtime/helpers/AsyncGenerator'>;472}473declare module '@babel/runtime/helpers/asyncGeneratorDelegate.js' {474 declare module.exports: $Exports<'@babel/runtime/helpers/asyncGeneratorDelegate'>;475}476declare module '@babel/runtime/helpers/asyncIterator.js' {477 declare module.exports: $Exports<'@babel/runtime/helpers/asyncIterator'>;478}479declare module '@babel/runtime/helpers/asyncToGenerator.js' {480 declare module.exports: $Exports<'@babel/runtime/helpers/asyncToGenerator'>;481}482declare module '@babel/runtime/helpers/awaitAsyncGenerator.js' {483 declare module.exports: $Exports<'@babel/runtime/helpers/awaitAsyncGenerator'>;484}485declare module '@babel/runtime/helpers/AwaitValue.js' {486 declare module.exports: $Exports<'@babel/runtime/helpers/AwaitValue'>;487}488declare module '@babel/runtime/helpers/classCallCheck.js' {489 declare module.exports: $Exports<'@babel/runtime/helpers/classCallCheck'>;490}491declare module '@babel/runtime/helpers/classNameTDZError.js' {492 declare module.exports: $Exports<'@babel/runtime/helpers/classNameTDZError'>;493}494declare module '@babel/runtime/helpers/classPrivateFieldDestructureSet.js' {495 declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateFieldDestructureSet'>;496}497declare module '@babel/runtime/helpers/classPrivateFieldGet.js' {498 declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateFieldGet'>;499}500declare module '@babel/runtime/helpers/classPrivateFieldLooseBase.js' {501 declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateFieldLooseBase'>;502}503declare module '@babel/runtime/helpers/classPrivateFieldLooseKey.js' {504 declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateFieldLooseKey'>;505}506declare module '@babel/runtime/helpers/classPrivateFieldSet.js' {507 declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateFieldSet'>;508}509declare module '@babel/runtime/helpers/classPrivateMethodGet.js' {510 declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateMethodGet'>;511}512declare module '@babel/runtime/helpers/classPrivateMethodSet.js' {513 declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateMethodSet'>;514}515declare module '@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js' {516 declare module.exports: $Exports<'@babel/runtime/helpers/classStaticPrivateFieldSpecGet'>;517}518declare module '@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js' {519 declare module.exports: $Exports<'@babel/runtime/helpers/classStaticPrivateFieldSpecSet'>;520}521declare module '@babel/runtime/helpers/classStaticPrivateMethodGet.js' {522 declare module.exports: $Exports<'@babel/runtime/helpers/classStaticPrivateMethodGet'>;523}524declare module '@babel/runtime/helpers/classStaticPrivateMethodSet.js' {525 declare module.exports: $Exports<'@babel/runtime/helpers/classStaticPrivateMethodSet'>;526}527declare module '@babel/runtime/helpers/construct.js' {528 declare module.exports: $Exports<'@babel/runtime/helpers/construct'>;529}530declare module '@babel/runtime/helpers/createClass.js' {531 declare module.exports: $Exports<'@babel/runtime/helpers/createClass'>;532}533declare module '@babel/runtime/helpers/decorate.js' {534 declare module.exports: $Exports<'@babel/runtime/helpers/decorate'>;535}536declare module '@babel/runtime/helpers/defaults.js' {537 declare module.exports: $Exports<'@babel/runtime/helpers/defaults'>;538}539declare module '@babel/runtime/helpers/defineEnumerableProperties.js' {540 declare module.exports: $Exports<'@babel/runtime/helpers/defineEnumerableProperties'>;541}542declare module '@babel/runtime/helpers/defineProperty.js' {543 declare module.exports: $Exports<'@babel/runtime/helpers/defineProperty'>;544}545declare module '@babel/runtime/helpers/esm/applyDecoratedDescriptor.js' {546 declare module.exports: $Exports<'@babel/runtime/helpers/esm/applyDecoratedDescriptor'>;547}548declare module '@babel/runtime/helpers/esm/arrayWithHoles.js' {549 declare module.exports: $Exports<'@babel/runtime/helpers/esm/arrayWithHoles'>;550}551declare module '@babel/runtime/helpers/esm/arrayWithoutHoles.js' {552 declare module.exports: $Exports<'@babel/runtime/helpers/esm/arrayWithoutHoles'>;553}554declare module '@babel/runtime/helpers/esm/assertThisInitialized.js' {555 declare module.exports: $Exports<'@babel/runtime/helpers/esm/assertThisInitialized'>;556}557declare module '@babel/runtime/helpers/esm/AsyncGenerator.js' {558 declare module.exports: $Exports<'@babel/runtime/helpers/esm/AsyncGenerator'>;559}560declare module '@babel/runtime/helpers/esm/asyncGeneratorDelegate.js' {561 declare module.exports: $Exports<'@babel/runtime/helpers/esm/asyncGeneratorDelegate'>;562}563declare module '@babel/runtime/helpers/esm/asyncIterator.js' {564 declare module.exports: $Exports<'@babel/runtime/helpers/esm/asyncIterator'>;565}566declare module '@babel/runtime/helpers/esm/asyncToGenerator.js' {567 declare module.exports: $Exports<'@babel/runtime/helpers/esm/asyncToGenerator'>;568}569declare module '@babel/runtime/helpers/esm/awaitAsyncGenerator.js' {570 declare module.exports: $Exports<'@babel/runtime/helpers/esm/awaitAsyncGenerator'>;571}572declare module '@babel/runtime/helpers/esm/AwaitValue.js' {573 declare module.exports: $Exports<'@babel/runtime/helpers/esm/AwaitValue'>;574}575declare module '@babel/runtime/helpers/esm/classCallCheck.js' {576 declare module.exports: $Exports<'@babel/runtime/helpers/esm/classCallCheck'>;577}578declare module '@babel/runtime/helpers/esm/classNameTDZError.js' {579 declare module.exports: $Exports<'@babel/runtime/helpers/esm/classNameTDZError'>;580}581declare module '@babel/runtime/helpers/esm/classPrivateFieldDestructureSet.js' {582 declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateFieldDestructureSet'>;583}584declare module '@babel/runtime/helpers/esm/classPrivateFieldGet.js' {585 declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateFieldGet'>;586}587declare module '@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js' {588 declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateFieldLooseBase'>;589}590declare module '@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js' {591 declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateFieldLooseKey'>;592}593declare module '@babel/runtime/helpers/esm/classPrivateFieldSet.js' {594 declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateFieldSet'>;595}596declare module '@babel/runtime/helpers/esm/classPrivateMethodGet.js' {597 declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateMethodGet'>;598}599declare module '@babel/runtime/helpers/esm/classPrivateMethodSet.js' {600 declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateMethodSet'>;601}602declare module '@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js' {603 declare module.exports: $Exports<'@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet'>;604}605declare module '@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js' {606 declare module.exports: $Exports<'@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet'>;607}608declare module '@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js' {609 declare module.exports: $Exports<'@babel/runtime/helpers/esm/classStaticPrivateMethodGet'>;610}611declare module '@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js' {612 declare module.exports: $Exports<'@babel/runtime/helpers/esm/classStaticPrivateMethodSet'>;613}614declare module '@babel/runtime/helpers/esm/construct.js' {615 declare module.exports: $Exports<'@babel/runtime/helpers/esm/construct'>;616}617declare module '@babel/runtime/helpers/esm/createClass.js' {618 declare module.exports: $Exports<'@babel/runtime/helpers/esm/createClass'>;619}620declare module '@babel/runtime/helpers/esm/decorate.js' {621 declare module.exports: $Exports<'@babel/runtime/helpers/esm/decorate'>;622}623declare module '@babel/runtime/helpers/esm/defaults.js' {624 declare module.exports: $Exports<'@babel/runtime/helpers/esm/defaults'>;625}626declare module '@babel/runtime/helpers/esm/defineEnumerableProperties.js' {627 declare module.exports: $Exports<'@babel/runtime/helpers/esm/defineEnumerableProperties'>;628}629declare module '@babel/runtime/helpers/esm/defineProperty.js' {630 declare module.exports: $Exports<'@babel/runtime/helpers/esm/defineProperty'>;631}632declare module '@babel/runtime/helpers/esm/extends.js' {633 declare module.exports: $Exports<'@babel/runtime/helpers/esm/extends'>;634}635declare module '@babel/runtime/helpers/esm/get.js' {636 declare module.exports: $Exports<'@babel/runtime/helpers/esm/get'>;637}638declare module '@babel/runtime/helpers/esm/getPrototypeOf.js' {639 declare module.exports: $Exports<'@babel/runtime/helpers/esm/getPrototypeOf'>;640}641declare module '@babel/runtime/helpers/esm/inherits.js' {642 declare module.exports: $Exports<'@babel/runtime/helpers/esm/inherits'>;643}644declare module '@babel/runtime/helpers/esm/inheritsLoose.js' {645 declare module.exports: $Exports<'@babel/runtime/helpers/esm/inheritsLoose'>;646}647declare module '@babel/runtime/helpers/esm/initializerDefineProperty.js' {648 declare module.exports: $Exports<'@babel/runtime/helpers/esm/initializerDefineProperty'>;649}650declare module '@babel/runtime/helpers/esm/initializerWarningHelper.js' {651 declare module.exports: $Exports<'@babel/runtime/helpers/esm/initializerWarningHelper'>;652}653declare module '@babel/runtime/helpers/esm/instanceof.js' {654 declare module.exports: $Exports<'@babel/runtime/helpers/esm/instanceof'>;655}656declare module '@babel/runtime/helpers/esm/interopRequireDefault.js' {657 declare module.exports: $Exports<'@babel/runtime/helpers/esm/interopRequireDefault'>;658}659declare module '@babel/runtime/helpers/esm/interopRequireWildcard.js' {660 declare module.exports: $Exports<'@babel/runtime/helpers/esm/interopRequireWildcard'>;661}662declare module '@babel/runtime/helpers/esm/isNativeFunction.js' {663 declare module.exports: $Exports<'@babel/runtime/helpers/esm/isNativeFunction'>;664}665declare module '@babel/runtime/helpers/esm/iterableToArray.js' {666 declare module.exports: $Exports<'@babel/runtime/helpers/esm/iterableToArray'>;667}668declare module '@babel/runtime/helpers/esm/iterableToArrayLimit.js' {669 declare module.exports: $Exports<'@babel/runtime/helpers/esm/iterableToArrayLimit'>;670}671declare module '@babel/runtime/helpers/esm/iterableToArrayLimitLoose.js' {672 declare module.exports: $Exports<'@babel/runtime/helpers/esm/iterableToArrayLimitLoose'>;673}674declare module '@babel/runtime/helpers/esm/jsx.js' {675 declare module.exports: $Exports<'@babel/runtime/helpers/esm/jsx'>;676}677declare module '@babel/runtime/helpers/esm/newArrowCheck.js' {678 declare module.exports: $Exports<'@babel/runtime/helpers/esm/newArrowCheck'>;679}680declare module '@babel/runtime/helpers/esm/nonIterableRest.js' {681 declare module.exports: $Exports<'@babel/runtime/helpers/esm/nonIterableRest'>;682}683declare module '@babel/runtime/helpers/esm/nonIterableSpread.js' {684 declare module.exports: $Exports<'@babel/runtime/helpers/esm/nonIterableSpread'>;685}686declare module '@babel/runtime/helpers/esm/objectDestructuringEmpty.js' {687 declare module.exports: $Exports<'@babel/runtime/helpers/esm/objectDestructuringEmpty'>;688}689declare module '@babel/runtime/helpers/esm/objectSpread.js' {690 declare module.exports: $Exports<'@babel/runtime/helpers/esm/objectSpread'>;691}692declare module '@babel/runtime/helpers/esm/objectSpread2.js' {693 declare module.exports: $Exports<'@babel/runtime/helpers/esm/objectSpread2'>;694}695declare module '@babel/runtime/helpers/esm/objectWithoutProperties.js' {696 declare module.exports: $Exports<'@babel/runtime/helpers/esm/objectWithoutProperties'>;697}698declare module '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js' {699 declare module.exports: $Exports<'@babel/runtime/helpers/esm/objectWithoutPropertiesLoose'>;700}701declare module '@babel/runtime/helpers/esm/possibleConstructorReturn.js' {702 declare module.exports: $Exports<'@babel/runtime/helpers/esm/possibleConstructorReturn'>;703}704declare module '@babel/runtime/helpers/esm/readOnlyError.js' {705 declare module.exports: $Exports<'@babel/runtime/helpers/esm/readOnlyError'>;706}707declare module '@babel/runtime/helpers/esm/set.js' {708 declare module.exports: $Exports<'@babel/runtime/helpers/esm/set'>;709}710declare module '@babel/runtime/helpers/esm/setPrototypeOf.js' {711 declare module.exports: $Exports<'@babel/runtime/helpers/esm/setPrototypeOf'>;712}713declare module '@babel/runtime/helpers/esm/skipFirstGeneratorNext.js' {714 declare module.exports: $Exports<'@babel/runtime/helpers/esm/skipFirstGeneratorNext'>;715}716declare module '@babel/runtime/helpers/esm/slicedToArray.js' {717 declare module.exports: $Exports<'@babel/runtime/helpers/esm/slicedToArray'>;718}719declare module '@babel/runtime/helpers/esm/slicedToArrayLoose.js' {720 declare module.exports: $Exports<'@babel/runtime/helpers/esm/slicedToArrayLoose'>;721}722declare module '@babel/runtime/helpers/esm/superPropBase.js' {723 declare module.exports: $Exports<'@babel/runtime/helpers/esm/superPropBase'>;724}725declare module '@babel/runtime/helpers/esm/taggedTemplateLiteral.js' {726 declare module.exports: $Exports<'@babel/runtime/helpers/esm/taggedTemplateLiteral'>;727}728declare module '@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js' {729 declare module.exports: $Exports<'@babel/runtime/helpers/esm/taggedTemplateLiteralLoose'>;730}731declare module '@babel/runtime/helpers/esm/temporalRef.js' {732 declare module.exports: $Exports<'@babel/runtime/helpers/esm/temporalRef'>;733}734declare module '@babel/runtime/helpers/esm/temporalUndefined.js' {735 declare module.exports: $Exports<'@babel/runtime/helpers/esm/temporalUndefined'>;736}737declare module '@babel/runtime/helpers/esm/toArray.js' {738 declare module.exports: $Exports<'@babel/runtime/helpers/esm/toArray'>;739}740declare module '@babel/runtime/helpers/esm/toConsumableArray.js' {741 declare module.exports: $Exports<'@babel/runtime/helpers/esm/toConsumableArray'>;742}743declare module '@babel/runtime/helpers/esm/toPrimitive.js' {744 declare module.exports: $Exports<'@babel/runtime/helpers/esm/toPrimitive'>;745}746declare module '@babel/runtime/helpers/esm/toPropertyKey.js' {747 declare module.exports: $Exports<'@babel/runtime/helpers/esm/toPropertyKey'>;748}749declare module '@babel/runtime/helpers/esm/typeof.js' {750 declare module.exports: $Exports<'@babel/runtime/helpers/esm/typeof'>;751}752declare module '@babel/runtime/helpers/esm/wrapAsyncGenerator.js' {753 declare module.exports: $Exports<'@babel/runtime/helpers/esm/wrapAsyncGenerator'>;754}755declare module '@babel/runtime/helpers/esm/wrapNativeSuper.js' {756 declare module.exports: $Exports<'@babel/runtime/helpers/esm/wrapNativeSuper'>;757}758declare module '@babel/runtime/helpers/esm/wrapRegExp.js' {759 declare module.exports: $Exports<'@babel/runtime/helpers/esm/wrapRegExp'>;760}761declare module '@babel/runtime/helpers/extends.js' {762 declare module.exports: $Exports<'@babel/runtime/helpers/extends'>;763}764declare module '@babel/runtime/helpers/get.js' {765 declare module.exports: $Exports<'@babel/runtime/helpers/get'>;766}767declare module '@babel/runtime/helpers/getPrototypeOf.js' {768 declare module.exports: $Exports<'@babel/runtime/helpers/getPrototypeOf'>;769}770declare module '@babel/runtime/helpers/inherits.js' {771 declare module.exports: $Exports<'@babel/runtime/helpers/inherits'>;772}773declare module '@babel/runtime/helpers/inheritsLoose.js' {774 declare module.exports: $Exports<'@babel/runtime/helpers/inheritsLoose'>;775}776declare module '@babel/runtime/helpers/initializerDefineProperty.js' {777 declare module.exports: $Exports<'@babel/runtime/helpers/initializerDefineProperty'>;778}779declare module '@babel/runtime/helpers/initializerWarningHelper.js' {780 declare module.exports: $Exports<'@babel/runtime/helpers/initializerWarningHelper'>;781}782declare module '@babel/runtime/helpers/instanceof.js' {783 declare module.exports: $Exports<'@babel/runtime/helpers/instanceof'>;784}785declare module '@babel/runtime/helpers/interopRequireDefault.js' {786 declare module.exports: $Exports<'@babel/runtime/helpers/interopRequireDefault'>;787}788declare module '@babel/runtime/helpers/interopRequireWildcard.js' {789 declare module.exports: $Exports<'@babel/runtime/helpers/interopRequireWildcard'>;790}791declare module '@babel/runtime/helpers/isNativeFunction.js' {792 declare module.exports: $Exports<'@babel/runtime/helpers/isNativeFunction'>;793}794declare module '@babel/runtime/helpers/iterableToArray.js' {795 declare module.exports: $Exports<'@babel/runtime/helpers/iterableToArray'>;796}797declare module '@babel/runtime/helpers/iterableToArrayLimit.js' {798 declare module.exports: $Exports<'@babel/runtime/helpers/iterableToArrayLimit'>;799}800declare module '@babel/runtime/helpers/iterableToArrayLimitLoose.js' {801 declare module.exports: $Exports<'@babel/runtime/helpers/iterableToArrayLimitLoose'>;802}803declare module '@babel/runtime/helpers/jsx.js' {804 declare module.exports: $Exports<'@babel/runtime/helpers/jsx'>;805}806declare module '@babel/runtime/helpers/newArrowCheck.js' {807 declare module.exports: $Exports<'@babel/runtime/helpers/newArrowCheck'>;808}809declare module '@babel/runtime/helpers/nonIterableRest.js' {810 declare module.exports: $Exports<'@babel/runtime/helpers/nonIterableRest'>;811}812declare module '@babel/runtime/helpers/nonIterableSpread.js' {813 declare module.exports: $Exports<'@babel/runtime/helpers/nonIterableSpread'>;814}815declare module '@babel/runtime/helpers/objectDestructuringEmpty.js' {816 declare module.exports: $Exports<'@babel/runtime/helpers/objectDestructuringEmpty'>;817}818declare module '@babel/runtime/helpers/objectSpread.js' {819 declare module.exports: $Exports<'@babel/runtime/helpers/objectSpread'>;820}821declare module '@babel/runtime/helpers/objectSpread2.js' {822 declare module.exports: $Exports<'@babel/runtime/helpers/objectSpread2'>;823}824declare module '@babel/runtime/helpers/objectWithoutProperties.js' {825 declare module.exports: $Exports<'@babel/runtime/helpers/objectWithoutProperties'>;826}827declare module '@babel/runtime/helpers/objectWithoutPropertiesLoose.js' {828 declare module.exports: $Exports<'@babel/runtime/helpers/objectWithoutPropertiesLoose'>;829}830declare module '@babel/runtime/helpers/possibleConstructorReturn.js' {831 declare module.exports: $Exports<'@babel/runtime/helpers/possibleConstructorReturn'>;832}833declare module '@babel/runtime/helpers/readOnlyError.js' {834 declare module.exports: $Exports<'@babel/runtime/helpers/readOnlyError'>;835}836declare module '@babel/runtime/helpers/set.js' {837 declare module.exports: $Exports<'@babel/runtime/helpers/set'>;838}839declare module '@babel/runtime/helpers/setPrototypeOf.js' {840 declare module.exports: $Exports<'@babel/runtime/helpers/setPrototypeOf'>;841}842declare module '@babel/runtime/helpers/skipFirstGeneratorNext.js' {843 declare module.exports: $Exports<'@babel/runtime/helpers/skipFirstGeneratorNext'>;844}845declare module '@babel/runtime/helpers/slicedToArray.js' {846 declare module.exports: $Exports<'@babel/runtime/helpers/slicedToArray'>;847}848declare module '@babel/runtime/helpers/slicedToArrayLoose.js' {849 declare module.exports: $Exports<'@babel/runtime/helpers/slicedToArrayLoose'>;850}851declare module '@babel/runtime/helpers/superPropBase.js' {852 declare module.exports: $Exports<'@babel/runtime/helpers/superPropBase'>;853}854declare module '@babel/runtime/helpers/taggedTemplateLiteral.js' {855 declare module.exports: $Exports<'@babel/runtime/helpers/taggedTemplateLiteral'>;856}857declare module '@babel/runtime/helpers/taggedTemplateLiteralLoose.js' {858 declare module.exports: $Exports<'@babel/runtime/helpers/taggedTemplateLiteralLoose'>;859}860declare module '@babel/runtime/helpers/temporalRef.js' {861 declare module.exports: $Exports<'@babel/runtime/helpers/temporalRef'>;862}863declare module '@babel/runtime/helpers/temporalUndefined.js' {864 declare module.exports: $Exports<'@babel/runtime/helpers/temporalUndefined'>;865}866declare module '@babel/runtime/helpers/toArray.js' {867 declare module.exports: $Exports<'@babel/runtime/helpers/toArray'>;868}869declare module '@babel/runtime/helpers/toConsumableArray.js' {870 declare module.exports: $Exports<'@babel/runtime/helpers/toConsumableArray'>;871}872declare module '@babel/runtime/helpers/toPrimitive.js' {873 declare module.exports: $Exports<'@babel/runtime/helpers/toPrimitive'>;874}875declare module '@babel/runtime/helpers/toPropertyKey.js' {876 declare module.exports: $Exports<'@babel/runtime/helpers/toPropertyKey'>;877}878declare module '@babel/runtime/helpers/typeof.js' {879 declare module.exports: $Exports<'@babel/runtime/helpers/typeof'>;880}881declare module '@babel/runtime/helpers/wrapAsyncGenerator.js' {882 declare module.exports: $Exports<'@babel/runtime/helpers/wrapAsyncGenerator'>;883}884declare module '@babel/runtime/helpers/wrapNativeSuper.js' {885 declare module.exports: $Exports<'@babel/runtime/helpers/wrapNativeSuper'>;886}887declare module '@babel/runtime/helpers/wrapRegExp.js' {888 declare module.exports: $Exports<'@babel/runtime/helpers/wrapRegExp'>;889}890declare module '@babel/runtime/regenerator/index' {891 declare module.exports: $Exports<'@babel/runtime/regenerator'>;892}893declare module '@babel/runtime/regenerator/index.js' {894 declare module.exports: $Exports<'@babel/runtime/regenerator'>;...

Full Screen

Full Screen

runtime.js

Source:runtime.js Github

copy

Full Screen

...67 set.sort();68 return Array.from(set).join("\n");69};70/**71 * @param {RuntimeSpec} runtime runtime(s)72 * @returns {string} key of runtimes73 */74const getRuntimeKey = runtime => {75 if (runtime === undefined) return "*";76 if (typeof runtime === "string") return runtime;77 return runtime.getFromUnorderedCache(getRuntimesKey);78};79exports.getRuntimeKey = getRuntimeKey;80/**81 * @param {string} key key of runtimes82 * @returns {RuntimeSpec} runtime(s)83 */84const keyToRuntime = key => {85 if (key === "*") return undefined;86 const items = key.split("\n");87 if (items.length === 1) return items[0];88 return new SortableSet(items);89};90exports.keyToRuntime = keyToRuntime;91const getRuntimesString = set => {92 set.sort();93 return Array.from(set).join("+");94};95/**96 * @param {RuntimeSpec} runtime runtime(s)97 * @returns {string} readable version98 */99const runtimeToString = runtime => {100 if (runtime === undefined) return "*";101 if (typeof runtime === "string") return runtime;102 return runtime.getFromUnorderedCache(getRuntimesString);103};104exports.runtimeToString = runtimeToString;105/**106 * @param {RuntimeCondition} runtimeCondition runtime condition107 * @returns {string} readable version108 */109exports.runtimeConditionToString = runtimeCondition => {110 if (runtimeCondition === true) return "true";...

Full Screen

Full Screen

RuntimePlugin.js

Source:RuntimePlugin.js Github

copy

Full Screen

1/*2 MIT License http://www.opensource.org/licenses/mit-license.php3 Author Tobias Koppers @sokra4*/5"use strict";6const RuntimeGlobals = require("./RuntimeGlobals");7const RuntimeRequirementsDependency = require("./dependencies/RuntimeRequirementsDependency");8const JavascriptModulesPlugin = require("./javascript/JavascriptModulesPlugin");9const AsyncModuleRuntimeModule = require("./runtime/AsyncModuleRuntimeModule");10const AutoPublicPathRuntimeModule = require("./runtime/AutoPublicPathRuntimeModule");11const CompatGetDefaultExportRuntimeModule = require("./runtime/CompatGetDefaultExportRuntimeModule");12const CompatRuntimeModule = require("./runtime/CompatRuntimeModule");13const CreateFakeNamespaceObjectRuntimeModule = require("./runtime/CreateFakeNamespaceObjectRuntimeModule");14const CreateScriptUrlRuntimeModule = require("./runtime/CreateScriptUrlRuntimeModule");15const DefinePropertyGettersRuntimeModule = require("./runtime/DefinePropertyGettersRuntimeModule");16const EnsureChunkRuntimeModule = require("./runtime/EnsureChunkRuntimeModule");17const GetChunkFilenameRuntimeModule = require("./runtime/GetChunkFilenameRuntimeModule");18const GetMainFilenameRuntimeModule = require("./runtime/GetMainFilenameRuntimeModule");19const GlobalRuntimeModule = require("./runtime/GlobalRuntimeModule");20const HasOwnPropertyRuntimeModule = require("./runtime/HasOwnPropertyRuntimeModule");21const LoadScriptRuntimeModule = require("./runtime/LoadScriptRuntimeModule");22const MakeNamespaceObjectRuntimeModule = require("./runtime/MakeNamespaceObjectRuntimeModule");23const OnChunksLoadedRuntimeModule = require("./runtime/OnChunksLoadedRuntimeModule");24const PublicPathRuntimeModule = require("./runtime/PublicPathRuntimeModule");25const RelativeUrlRuntimeModule = require("./runtime/RelativeUrlRuntimeModule");26const RuntimeIdRuntimeModule = require("./runtime/RuntimeIdRuntimeModule");27const SystemContextRuntimeModule = require("./runtime/SystemContextRuntimeModule");28const ShareRuntimeModule = require("./sharing/ShareRuntimeModule");29const StringXor = require("./util/StringXor");30/** @typedef {import("./Chunk")} Chunk */31/** @typedef {import("./Compiler")} Compiler */32/** @typedef {import("./Module")} Module */33const GLOBALS_ON_REQUIRE = [34 RuntimeGlobals.chunkName,35 RuntimeGlobals.runtimeId,36 RuntimeGlobals.compatGetDefaultExport,37 RuntimeGlobals.createFakeNamespaceObject,38 RuntimeGlobals.createScriptUrl,39 RuntimeGlobals.definePropertyGetters,40 RuntimeGlobals.ensureChunk,41 RuntimeGlobals.entryModuleId,42 RuntimeGlobals.getFullHash,43 RuntimeGlobals.global,44 RuntimeGlobals.makeNamespaceObject,45 RuntimeGlobals.moduleCache,46 RuntimeGlobals.moduleFactories,47 RuntimeGlobals.moduleFactoriesAddOnly,48 RuntimeGlobals.interceptModuleExecution,49 RuntimeGlobals.publicPath,50 RuntimeGlobals.baseURI,51 RuntimeGlobals.relativeUrl,52 RuntimeGlobals.scriptNonce,53 RuntimeGlobals.uncaughtErrorHandler,54 RuntimeGlobals.asyncModule,55 RuntimeGlobals.wasmInstances,56 RuntimeGlobals.instantiateWasm,57 RuntimeGlobals.shareScopeMap,58 RuntimeGlobals.initializeSharing,59 RuntimeGlobals.loadScript,60 RuntimeGlobals.systemContext,61 RuntimeGlobals.onChunksLoaded62];63const MODULE_DEPENDENCIES = {64 [RuntimeGlobals.moduleLoaded]: [RuntimeGlobals.module],65 [RuntimeGlobals.moduleId]: [RuntimeGlobals.module]66};67const TREE_DEPENDENCIES = {68 [RuntimeGlobals.definePropertyGetters]: [RuntimeGlobals.hasOwnProperty],69 [RuntimeGlobals.compatGetDefaultExport]: [70 RuntimeGlobals.definePropertyGetters71 ],72 [RuntimeGlobals.createFakeNamespaceObject]: [73 RuntimeGlobals.definePropertyGetters,74 RuntimeGlobals.makeNamespaceObject,75 RuntimeGlobals.require76 ],77 [RuntimeGlobals.initializeSharing]: [RuntimeGlobals.shareScopeMap],78 [RuntimeGlobals.shareScopeMap]: [RuntimeGlobals.hasOwnProperty]79};80class RuntimePlugin {81 /**82 * @param {Compiler} compiler the Compiler83 * @returns {void}84 */85 apply(compiler) {86 compiler.hooks.compilation.tap("RuntimePlugin", compilation => {87 compilation.dependencyTemplates.set(88 RuntimeRequirementsDependency,89 new RuntimeRequirementsDependency.Template()90 );91 for (const req of GLOBALS_ON_REQUIRE) {92 compilation.hooks.runtimeRequirementInModule93 .for(req)94 .tap("RuntimePlugin", (module, set) => {95 set.add(RuntimeGlobals.requireScope);96 });97 compilation.hooks.runtimeRequirementInTree98 .for(req)99 .tap("RuntimePlugin", (module, set) => {100 set.add(RuntimeGlobals.requireScope);101 });102 }103 for (const req of Object.keys(TREE_DEPENDENCIES)) {104 const deps = TREE_DEPENDENCIES[req];105 compilation.hooks.runtimeRequirementInTree106 .for(req)107 .tap("RuntimePlugin", (chunk, set) => {108 for (const dep of deps) set.add(dep);109 });110 }111 for (const req of Object.keys(MODULE_DEPENDENCIES)) {112 const deps = MODULE_DEPENDENCIES[req];113 compilation.hooks.runtimeRequirementInModule114 .for(req)115 .tap("RuntimePlugin", (chunk, set) => {116 for (const dep of deps) set.add(dep);117 });118 }119 compilation.hooks.runtimeRequirementInTree120 .for(RuntimeGlobals.definePropertyGetters)121 .tap("RuntimePlugin", chunk => {122 compilation.addRuntimeModule(123 chunk,124 new DefinePropertyGettersRuntimeModule()125 );126 return true;127 });128 compilation.hooks.runtimeRequirementInTree129 .for(RuntimeGlobals.makeNamespaceObject)130 .tap("RuntimePlugin", chunk => {131 compilation.addRuntimeModule(132 chunk,133 new MakeNamespaceObjectRuntimeModule()134 );135 return true;136 });137 compilation.hooks.runtimeRequirementInTree138 .for(RuntimeGlobals.createFakeNamespaceObject)139 .tap("RuntimePlugin", chunk => {140 compilation.addRuntimeModule(141 chunk,142 new CreateFakeNamespaceObjectRuntimeModule()143 );144 return true;145 });146 compilation.hooks.runtimeRequirementInTree147 .for(RuntimeGlobals.hasOwnProperty)148 .tap("RuntimePlugin", chunk => {149 compilation.addRuntimeModule(150 chunk,151 new HasOwnPropertyRuntimeModule()152 );153 return true;154 });155 compilation.hooks.runtimeRequirementInTree156 .for(RuntimeGlobals.compatGetDefaultExport)157 .tap("RuntimePlugin", chunk => {158 compilation.addRuntimeModule(159 chunk,160 new CompatGetDefaultExportRuntimeModule()161 );162 return true;163 });164 compilation.hooks.runtimeRequirementInTree165 .for(RuntimeGlobals.runtimeId)166 .tap("RuntimePlugin", chunk => {167 compilation.addRuntimeModule(chunk, new RuntimeIdRuntimeModule());168 return true;169 });170 compilation.hooks.runtimeRequirementInTree171 .for(RuntimeGlobals.publicPath)172 .tap("RuntimePlugin", (chunk, set) => {173 const { outputOptions } = compilation;174 const { publicPath: globalPublicPath, scriptType } = outputOptions;175 const entryOptions = chunk.getEntryOptions();176 const publicPath =177 entryOptions && entryOptions.publicPath !== undefined178 ? entryOptions.publicPath179 : globalPublicPath;180 if (publicPath === "auto") {181 const module = new AutoPublicPathRuntimeModule();182 if (scriptType !== "module") set.add(RuntimeGlobals.global);183 compilation.addRuntimeModule(chunk, module);184 } else {185 const module = new PublicPathRuntimeModule(publicPath);186 if (187 typeof publicPath !== "string" ||188 /\[(full)?hash\]/.test(publicPath)189 ) {190 module.fullHash = true;191 }192 compilation.addRuntimeModule(chunk, module);193 }194 return true;195 });196 compilation.hooks.runtimeRequirementInTree197 .for(RuntimeGlobals.global)198 .tap("RuntimePlugin", chunk => {199 compilation.addRuntimeModule(chunk, new GlobalRuntimeModule());200 return true;201 });202 compilation.hooks.runtimeRequirementInTree203 .for(RuntimeGlobals.asyncModule)204 .tap("RuntimePlugin", chunk => {205 compilation.addRuntimeModule(chunk, new AsyncModuleRuntimeModule());206 return true;207 });208 compilation.hooks.runtimeRequirementInTree209 .for(RuntimeGlobals.systemContext)210 .tap("RuntimePlugin", chunk => {211 if (compilation.outputOptions.library.type === "system") {212 compilation.addRuntimeModule(213 chunk,214 new SystemContextRuntimeModule()215 );216 }217 return true;218 });219 compilation.hooks.runtimeRequirementInTree220 .for(RuntimeGlobals.getChunkScriptFilename)221 .tap("RuntimePlugin", (chunk, set) => {222 if (223 typeof compilation.outputOptions.chunkFilename === "string" &&224 /\[(full)?hash(:\d+)?\]/.test(225 compilation.outputOptions.chunkFilename226 )227 ) {228 set.add(RuntimeGlobals.getFullHash);229 }230 compilation.addRuntimeModule(231 chunk,232 new GetChunkFilenameRuntimeModule(233 "javascript",234 "javascript",235 RuntimeGlobals.getChunkScriptFilename,236 chunk =>237 chunk.filenameTemplate ||238 (chunk.canBeInitial()239 ? compilation.outputOptions.filename240 : compilation.outputOptions.chunkFilename),241 false242 )243 );244 return true;245 });246 compilation.hooks.runtimeRequirementInTree247 .for(RuntimeGlobals.getChunkUpdateScriptFilename)248 .tap("RuntimePlugin", (chunk, set) => {249 if (250 /\[(full)?hash(:\d+)?\]/.test(251 compilation.outputOptions.hotUpdateChunkFilename252 )253 )254 set.add(RuntimeGlobals.getFullHash);255 compilation.addRuntimeModule(256 chunk,257 new GetChunkFilenameRuntimeModule(258 "javascript",259 "javascript update",260 RuntimeGlobals.getChunkUpdateScriptFilename,261 c => compilation.outputOptions.hotUpdateChunkFilename,262 true263 )264 );265 return true;266 });267 compilation.hooks.runtimeRequirementInTree268 .for(RuntimeGlobals.getUpdateManifestFilename)269 .tap("RuntimePlugin", (chunk, set) => {270 if (271 /\[(full)?hash(:\d+)?\]/.test(272 compilation.outputOptions.hotUpdateMainFilename273 )274 ) {275 set.add(RuntimeGlobals.getFullHash);276 }277 compilation.addRuntimeModule(278 chunk,279 new GetMainFilenameRuntimeModule(280 "update manifest",281 RuntimeGlobals.getUpdateManifestFilename,282 compilation.outputOptions.hotUpdateMainFilename283 )284 );285 return true;286 });287 compilation.hooks.runtimeRequirementInTree288 .for(RuntimeGlobals.ensureChunk)289 .tap("RuntimePlugin", (chunk, set) => {290 const hasAsyncChunks = chunk.hasAsyncChunks();291 if (hasAsyncChunks) {292 set.add(RuntimeGlobals.ensureChunkHandlers);293 }294 compilation.addRuntimeModule(295 chunk,296 new EnsureChunkRuntimeModule(set)297 );298 return true;299 });300 compilation.hooks.runtimeRequirementInTree301 .for(RuntimeGlobals.ensureChunkIncludeEntries)302 .tap("RuntimePlugin", (chunk, set) => {303 set.add(RuntimeGlobals.ensureChunkHandlers);304 });305 compilation.hooks.runtimeRequirementInTree306 .for(RuntimeGlobals.shareScopeMap)307 .tap("RuntimePlugin", (chunk, set) => {308 compilation.addRuntimeModule(chunk, new ShareRuntimeModule());309 return true;310 });311 compilation.hooks.runtimeRequirementInTree312 .for(RuntimeGlobals.loadScript)313 .tap("RuntimePlugin", (chunk, set) => {314 const withCreateScriptUrl = !!compilation.outputOptions.trustedTypes;315 if (withCreateScriptUrl) {316 set.add(RuntimeGlobals.createScriptUrl);317 }318 compilation.addRuntimeModule(319 chunk,320 new LoadScriptRuntimeModule(withCreateScriptUrl)321 );322 return true;323 });324 compilation.hooks.runtimeRequirementInTree325 .for(RuntimeGlobals.createScriptUrl)326 .tap("RuntimePlugin", (chunk, set) => {327 compilation.addRuntimeModule(328 chunk,329 new CreateScriptUrlRuntimeModule()330 );331 return true;332 });333 compilation.hooks.runtimeRequirementInTree334 .for(RuntimeGlobals.relativeUrl)335 .tap("RuntimePlugin", (chunk, set) => {336 compilation.addRuntimeModule(chunk, new RelativeUrlRuntimeModule());337 return true;338 });339 compilation.hooks.runtimeRequirementInTree340 .for(RuntimeGlobals.onChunksLoaded)341 .tap("RuntimePlugin", (chunk, set) => {342 compilation.addRuntimeModule(343 chunk,344 new OnChunksLoadedRuntimeModule()345 );346 return true;347 });348 // TODO webpack 6: remove CompatRuntimeModule349 compilation.hooks.additionalTreeRuntimeRequirements.tap(350 "RuntimePlugin",351 (chunk, set) => {352 const { mainTemplate } = compilation;353 if (354 mainTemplate.hooks.bootstrap.isUsed() ||355 mainTemplate.hooks.localVars.isUsed() ||356 mainTemplate.hooks.requireEnsure.isUsed() ||357 mainTemplate.hooks.requireExtensions.isUsed()358 ) {359 compilation.addRuntimeModule(chunk, new CompatRuntimeModule());360 }361 }362 );363 JavascriptModulesPlugin.getCompilationHooks(compilation).chunkHash.tap(364 "RuntimePlugin",365 (chunk, hash, { chunkGraph }) => {366 const xor = new StringXor();367 for (const m of chunkGraph.getChunkRuntimeModulesIterable(chunk)) {368 xor.add(chunkGraph.getModuleHash(m, chunk.runtime));369 }370 xor.updateHash(hash);371 }372 );373 });374 }375}...

Full Screen

Full Screen

index.ts

Source:index.ts Github

copy

Full Screen

1/*2 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one3 * or more contributor license agreements. Licensed under the Elastic License;4 * you may not use this file except in compliance with the Elastic License.5 */6/* eslint-disable @typescript-eslint/no-empty-interface */7import * as runtimeTypes from 'io-ts';8import { SavedObjectsClient } from 'kibana/server';9import { unionWithNullType } from '../../utility_types';10import { NoteSavedObject, NoteSavedObjectToReturnRuntimeType } from './note';11import { PinnedEventToReturnSavedObjectRuntimeType, PinnedEventSavedObject } from './pinned_event';12/*13 * ColumnHeader Types14 */15const SavedColumnHeaderRuntimeType = runtimeTypes.partial({16 aggregatable: unionWithNullType(runtimeTypes.boolean),17 category: unionWithNullType(runtimeTypes.string),18 columnHeaderType: unionWithNullType(runtimeTypes.string),19 description: unionWithNullType(runtimeTypes.string),20 example: unionWithNullType(runtimeTypes.string),21 indexes: unionWithNullType(runtimeTypes.array(runtimeTypes.string)),22 id: unionWithNullType(runtimeTypes.string),23 name: unionWithNullType(runtimeTypes.string),24 placeholder: unionWithNullType(runtimeTypes.string),25 searchable: unionWithNullType(runtimeTypes.boolean),26 type: unionWithNullType(runtimeTypes.string),27});28/*29 * DataProvider Types30 */31const SavedDataProviderQueryMatchBasicRuntimeType = runtimeTypes.partial({32 field: unionWithNullType(runtimeTypes.string),33 displayField: unionWithNullType(runtimeTypes.string),34 value: unionWithNullType(runtimeTypes.string),35 displayValue: unionWithNullType(runtimeTypes.string),36 operator: unionWithNullType(runtimeTypes.string),37});38const SavedDataProviderQueryMatchRuntimeType = runtimeTypes.partial({39 id: unionWithNullType(runtimeTypes.string),40 name: unionWithNullType(runtimeTypes.string),41 enabled: unionWithNullType(runtimeTypes.boolean),42 excluded: unionWithNullType(runtimeTypes.boolean),43 kqlQuery: unionWithNullType(runtimeTypes.string),44 queryMatch: unionWithNullType(SavedDataProviderQueryMatchBasicRuntimeType),45});46const SavedDataProviderRuntimeType = runtimeTypes.partial({47 id: unionWithNullType(runtimeTypes.string),48 name: unionWithNullType(runtimeTypes.string),49 enabled: unionWithNullType(runtimeTypes.boolean),50 excluded: unionWithNullType(runtimeTypes.boolean),51 kqlQuery: unionWithNullType(runtimeTypes.string),52 queryMatch: unionWithNullType(SavedDataProviderQueryMatchBasicRuntimeType),53 and: unionWithNullType(runtimeTypes.array(SavedDataProviderQueryMatchRuntimeType)),54});55/*56 * Filters Types57 */58const SavedFilterMetaRuntimeType = runtimeTypes.partial({59 alias: unionWithNullType(runtimeTypes.string),60 controlledBy: unionWithNullType(runtimeTypes.string),61 disabled: unionWithNullType(runtimeTypes.boolean),62 field: unionWithNullType(runtimeTypes.string),63 formattedValue: unionWithNullType(runtimeTypes.string),64 index: unionWithNullType(runtimeTypes.string),65 key: unionWithNullType(runtimeTypes.string),66 negate: unionWithNullType(runtimeTypes.boolean),67 params: unionWithNullType(runtimeTypes.string),68 type: unionWithNullType(runtimeTypes.string),69 value: unionWithNullType(runtimeTypes.string),70});71const SavedFilterRuntimeType = runtimeTypes.partial({72 exists: unionWithNullType(runtimeTypes.string),73 meta: unionWithNullType(SavedFilterMetaRuntimeType),74 match_all: unionWithNullType(runtimeTypes.string),75 missing: unionWithNullType(runtimeTypes.string),76 query: unionWithNullType(runtimeTypes.string),77 range: unionWithNullType(runtimeTypes.string),78 script: unionWithNullType(runtimeTypes.string),79});80/*81 * kqlQuery -> filterQuery Types82 */83const SavedKueryFilterQueryRuntimeType = runtimeTypes.partial({84 kind: unionWithNullType(runtimeTypes.string),85 expression: unionWithNullType(runtimeTypes.string),86});87const SavedSerializedFilterQueryQueryRuntimeType = runtimeTypes.partial({88 kuery: unionWithNullType(SavedKueryFilterQueryRuntimeType),89 serializedQuery: unionWithNullType(runtimeTypes.string),90});91const SavedFilterQueryQueryRuntimeType = runtimeTypes.partial({92 filterQuery: unionWithNullType(SavedSerializedFilterQueryQueryRuntimeType),93});94/*95 * DatePicker Range Types96 */97const SavedDateRangePickerRuntimeType = runtimeTypes.partial({98 start: unionWithNullType(runtimeTypes.number),99 end: unionWithNullType(runtimeTypes.number),100});101/*102 * Favorite Types103 */104const SavedFavoriteRuntimeType = runtimeTypes.partial({105 keySearch: unionWithNullType(runtimeTypes.string),106 favoriteDate: unionWithNullType(runtimeTypes.number),107 fullName: unionWithNullType(runtimeTypes.string),108 userName: unionWithNullType(runtimeTypes.string),109});110/*111 * Sort Types112 */113const SavedSortRuntimeType = runtimeTypes.partial({114 columnId: unionWithNullType(runtimeTypes.string),115 sortDirection: unionWithNullType(runtimeTypes.string),116});117/*118 * Timeline Statuses119 */120export enum TimelineStatus {121 active = 'active',122 draft = 'draft',123}124export const TimelineStatusLiteralRt = runtimeTypes.union([125 runtimeTypes.literal(TimelineStatus.active),126 runtimeTypes.literal(TimelineStatus.draft),127]);128const TimelineStatusLiteralWithNullRt = unionWithNullType(TimelineStatusLiteralRt);129export type TimelineStatusLiteral = runtimeTypes.TypeOf<typeof TimelineStatusLiteralRt>;130export type TimelineStatusLiteralWithNull = runtimeTypes.TypeOf<131 typeof TimelineStatusLiteralWithNullRt132>;133/*134 * Timeline Types135 */136export enum TimelineType {137 default = 'default',138 template = 'template',139}140export const TimelineTypeLiteralRt = runtimeTypes.union([141 runtimeTypes.literal(TimelineType.template),142 runtimeTypes.literal(TimelineType.default),143]);144export const TimelineTypeLiteralWithNullRt = unionWithNullType(TimelineTypeLiteralRt);145export type TimelineTypeLiteral = runtimeTypes.TypeOf<typeof TimelineTypeLiteralRt>;146export type TimelineTypeLiteralWithNull = runtimeTypes.TypeOf<typeof TimelineTypeLiteralWithNullRt>;147export const SavedTimelineRuntimeType = runtimeTypes.partial({148 columns: unionWithNullType(runtimeTypes.array(SavedColumnHeaderRuntimeType)),149 dataProviders: unionWithNullType(runtimeTypes.array(SavedDataProviderRuntimeType)),150 description: unionWithNullType(runtimeTypes.string),151 eventType: unionWithNullType(runtimeTypes.string),152 favorite: unionWithNullType(runtimeTypes.array(SavedFavoriteRuntimeType)),153 filters: unionWithNullType(runtimeTypes.array(SavedFilterRuntimeType)),154 kqlMode: unionWithNullType(runtimeTypes.string),155 kqlQuery: unionWithNullType(SavedFilterQueryQueryRuntimeType),156 title: unionWithNullType(runtimeTypes.string),157 templateTimelineId: unionWithNullType(runtimeTypes.string),158 templateTimelineVersion: unionWithNullType(runtimeTypes.number),159 timelineType: unionWithNullType(TimelineTypeLiteralRt),160 dateRange: unionWithNullType(SavedDateRangePickerRuntimeType),161 savedQueryId: unionWithNullType(runtimeTypes.string),162 sort: unionWithNullType(SavedSortRuntimeType),163 status: unionWithNullType(TimelineStatusLiteralRt),164 created: unionWithNullType(runtimeTypes.number),165 createdBy: unionWithNullType(runtimeTypes.string),166 updated: unionWithNullType(runtimeTypes.number),167 updatedBy: unionWithNullType(runtimeTypes.string),168});169export interface SavedTimeline extends runtimeTypes.TypeOf<typeof SavedTimelineRuntimeType> {}170export interface SavedTimelineNote extends runtimeTypes.TypeOf<typeof SavedTimelineRuntimeType> {}171/*172 * Timeline IDs173 */174export enum TimelineId {175 hostsPageEvents = 'hosts-page-events',176 hostsPageExternalAlerts = 'hosts-page-external-alerts',177 alertsRulesDetailsPage = 'alerts-rules-details-page',178 alertsPage = 'alerts-page',179 networkPageExternalAlerts = 'network-page-external-alerts',180 active = 'timeline-1',181 test = 'test', // Reserved for testing purposes182}183export const TimelineIdLiteralRt = runtimeTypes.union([184 runtimeTypes.literal(TimelineId.hostsPageEvents),185 runtimeTypes.literal(TimelineId.hostsPageExternalAlerts),186 runtimeTypes.literal(TimelineId.alertsRulesDetailsPage),187 runtimeTypes.literal(TimelineId.alertsPage),188 runtimeTypes.literal(TimelineId.networkPageExternalAlerts),189 runtimeTypes.literal(TimelineId.active),190 runtimeTypes.literal(TimelineId.test),191]);192export type TimelineIdLiteral = runtimeTypes.TypeOf<typeof TimelineIdLiteralRt>;193/**194 * Timeline Saved object type with metadata195 */196export const TimelineSavedObjectRuntimeType = runtimeTypes.intersection([197 runtimeTypes.type({198 id: runtimeTypes.string,199 attributes: SavedTimelineRuntimeType,200 version: runtimeTypes.string,201 }),202 runtimeTypes.partial({203 savedObjectId: runtimeTypes.string,204 }),205]);206export const TimelineSavedToReturnObjectRuntimeType = runtimeTypes.intersection([207 SavedTimelineRuntimeType,208 runtimeTypes.type({209 savedObjectId: runtimeTypes.string,210 version: runtimeTypes.string,211 }),212 runtimeTypes.partial({213 eventIdToNoteIds: runtimeTypes.array(NoteSavedObjectToReturnRuntimeType),214 noteIds: runtimeTypes.array(runtimeTypes.string),215 notes: runtimeTypes.array(NoteSavedObjectToReturnRuntimeType),216 pinnedEventIds: runtimeTypes.array(runtimeTypes.string),217 pinnedEventsSaveObject: runtimeTypes.array(PinnedEventToReturnSavedObjectRuntimeType),218 }),219]);220export interface TimelineSavedObject221 extends runtimeTypes.TypeOf<typeof TimelineSavedToReturnObjectRuntimeType> {}222/**223 * All Timeline Saved object type with metadata224 */225export const TimelineResponseType = runtimeTypes.type({226 data: runtimeTypes.type({227 persistTimeline: runtimeTypes.intersection([228 runtimeTypes.partial({229 code: unionWithNullType(runtimeTypes.number),230 message: unionWithNullType(runtimeTypes.string),231 }),232 runtimeTypes.type({233 timeline: TimelineSavedToReturnObjectRuntimeType,234 }),235 ]),236 }),237});238export interface TimelineResponse extends runtimeTypes.TypeOf<typeof TimelineResponseType> {}239/**240 * All Timeline Saved object type with metadata241 */242export const AllTimelineSavedObjectRuntimeType = runtimeTypes.type({243 total: runtimeTypes.number,244 data: TimelineSavedToReturnObjectRuntimeType,245});246export interface AllTimelineSavedObject247 extends runtimeTypes.TypeOf<typeof AllTimelineSavedObjectRuntimeType> {}248/**249 * Import/export timelines250 */251export type ExportTimelineSavedObjectsClient = Pick<252 SavedObjectsClient,253 | 'get'254 | 'errors'255 | 'create'256 | 'bulkCreate'257 | 'delete'258 | 'find'259 | 'bulkGet'260 | 'update'261 | 'bulkUpdate'262>;263export type ExportedGlobalNotes = Array<Exclude<NoteSavedObject, 'eventId'>>;264export type ExportedEventNotes = NoteSavedObject[];265export interface ExportedNotes {266 eventNotes: ExportedEventNotes;267 globalNotes: ExportedGlobalNotes;268}269export type ExportedTimelines = TimelineSavedObject &270 ExportedNotes & {271 pinnedEventIds: string[];272 };273export interface ExportTimelineNotFoundError {274 statusCode: number;275 message: string;276}277export interface BulkGetInput {278 type: string;279 id: string;280}281export type NotesAndPinnedEventsByTimelineId = Record<282 string,283 { notes: NoteSavedObject[]; pinnedEvents: PinnedEventSavedObject[] }...

Full Screen

Full Screen

runtimescenetools.js

Source:runtimescenetools.js Github

copy

Full Screen

1/*2 * GDevelop JS Platform3 * Copyright 2013-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved.4 * This project is released under the MIT License.5 */6/**7 * Tools related to runtime scene, for events generated code.8 * @memberof gdjs.evtTools9 * @class runtimeScene10 * @static11 * @private12 */13gdjs.evtTools.runtimeScene = gdjs.evtTools.runtimeScene || {};14gdjs.evtTools.runtimeScene.sceneJustBegins = function(runtimeScene) {15 return runtimeScene.getTimeManager().isFirstFrame();16};17gdjs.evtTools.runtimeScene.sceneJustResumed = function(runtimeScene) {18 return runtimeScene.sceneJustResumed();19};20gdjs.evtTools.runtimeScene.getSceneName = function(runtimeScene) {21 return runtimeScene.getName();22};23gdjs.evtTools.runtimeScene.setBackgroundColor = function(runtimeScene, rgbColor) {24 var colors = rgbColor.split(";");25 if ( colors.length < 3 ) return;26 runtimeScene.setBackgroundColor(parseInt(colors[0]),27 parseInt(colors[1]),28 parseInt(colors[2]));29};30gdjs.evtTools.runtimeScene.getElapsedTimeInSeconds = function(runtimeScene) {31 return runtimeScene.getTimeManager().getElapsedTime() / 1000;32};33gdjs.evtTools.runtimeScene.setTimeScale = function(runtimeScene, timeScale) {34 return runtimeScene.getTimeManager().setTimeScale(timeScale);35};36gdjs.evtTools.runtimeScene.getTimeScale = function(runtimeScene) {37 return runtimeScene.getTimeManager().getTimeScale();38};39gdjs.evtTools.runtimeScene.timerElapsedTime = function(runtimeScene, timeInSeconds, timerName) {40 var timeManager = runtimeScene.getTimeManager();41 if ( !timeManager.hasTimer(timerName) ) {42 timeManager.addTimer(timerName);43 return false;44 }45 return timeManager.getTimer(timerName).getTime() / 1000 >= timeInSeconds;46};47gdjs.evtTools.runtimeScene.timerPaused = function(runtimeScene, timerName) {48 var timeManager = runtimeScene.getTimeManager();49 if ( !timeManager.hasTimer(timerName) ) return false;50 return timeManager.getTimer(timerName).isPaused();51};52gdjs.evtTools.runtimeScene.resetTimer = function(runtimeScene, timerName) {53 var timeManager = runtimeScene.getTimeManager();54 if ( !timeManager.hasTimer(timerName) )55 timeManager.addTimer(timerName);56 else57 timeManager.getTimer(timerName).reset();58};59gdjs.evtTools.runtimeScene.pauseTimer = function(runtimeScene, timerName) {60 var timeManager = runtimeScene.getTimeManager();61 if ( !timeManager.hasTimer(timerName) ) timeManager.addTimer(timerName);62 timeManager.getTimer(timerName).setPaused(true);63};64gdjs.evtTools.runtimeScene.unpauseTimer = function(runtimeScene, timerName) {65 var timeManager = runtimeScene.getTimeManager();66 if ( !timeManager.hasTimer(timerName) ) timeManager.addTimer(timerName);67 return timeManager.getTimer(timerName).setPaused(false);68};69gdjs.evtTools.runtimeScene.removeTimer = function(runtimeScene, timerName) {70 var timeManager = runtimeScene.getTimeManager();71 timeManager.removeTimer(timerName);72};73gdjs.evtTools.runtimeScene.getTimerElapsedTimeInSeconds = function(runtimeScene, timerName) {74 var timeManager = runtimeScene.getTimeManager();75 if (!timeManager.hasTimer(timerName)) return 0;76 return timeManager.getTimer(timerName).getTime() / 1000;77};78gdjs.evtTools.runtimeScene.getTimeFromStartInSeconds = function(runtimeScene) {79 return runtimeScene.getTimeManager().getTimeFromStart() / 1000;80};81gdjs.evtTools.runtimeScene.getTime = function(runtimeScene, what) {82 if ( what === "timestamp" ) {83 return Date.now();84 }85 var now = new Date();86 if ( what === "hour" )87 return now.getHours();88 else if ( what === "min" )89 return now.getMinutes();90 else if ( what === "sec" )91 return now.getSeconds();92 else if ( what === "mday" )93 return now.getDate();94 else if ( what === "mon" )95 return now.getMonth();96 else if ( what === "year" )97 return now.getFullYear() - 1900; //Conform to the C way of returning years.98 else if ( what === "wday" )99 return now.getDay();100 else if ( what === "yday" ) {101 var start = new Date(now.getFullYear(), 0, 0);102 var diff = now - start;103 var oneDay = 1000 * 60 * 60 * 24;104 return Math.floor(diff / oneDay);105 }106 return 0;107};108gdjs.evtTools.runtimeScene.replaceScene = function(runtimeScene, newSceneName, clearOthers) {109 if (!runtimeScene.getGame().getSceneData(newSceneName)) return;110 runtimeScene.requestChange(clearOthers ?111 gdjs.RuntimeScene.CLEAR_SCENES :112 gdjs.RuntimeScene.REPLACE_SCENE, newSceneName);113};114gdjs.evtTools.runtimeScene.pushScene = function(runtimeScene, newSceneName) {115 if (!runtimeScene.getGame().getSceneData(newSceneName)) return;116 runtimeScene.requestChange(gdjs.RuntimeScene.PUSH_SCENE, newSceneName);117};118gdjs.evtTools.runtimeScene.popScene = function(runtimeScene) {119 runtimeScene.requestChange(gdjs.RuntimeScene.POP_SCENE);120};121gdjs.evtTools.runtimeScene.stopGame = function(runtimeScene) {122 runtimeScene.requestChange(gdjs.RuntimeScene.STOP_GAME);123};124gdjs.evtTools.runtimeScene.createObjectsFromExternalLayout = function(scene, externalLayout, xPos, yPos) {125 var externalLayoutData = scene.getGame().getExternalLayoutData(externalLayout);126 if ( externalLayoutData === null ) return;127 // trackByPersistentUuid is set to false as we don't want external layouts128 // instantiated at runtime to be hot-reloaded.129 scene.createObjectsFrom(externalLayoutData.instances, xPos, yPos, /*trackByPersistentUuid=*/ false);...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var test = wpt('www.webpagetest.org');3 if (err) return console.error(err);4 console.log('Test status: ' + data.statusText);5 test.getTestResults(data.data.testId, function(err, data) {6 if (err) return console.error(err);7 console.log('First View: ' + data.data.average.firstView.loadTime);8 console.log('Repeat View: ' + data.data.average.repeatView.loadTime);9 });10});11var wpt = require('webpagetest');12var test = wpt('www.webpagetest.org');13 if (err) return console.error(err);14 console.log('Test status: ' + data.statusText);15 test.getTestResults(data.data.testId, function(err, data) {16 if (err) return console.error(err);17 console.log('First View: ' + data.data.average.firstView.loadTime);18 console.log('Repeat View: ' + data.data.average.repeatView.loadTime);19 });20});21var wpt = require('webpagetest');22var test = wpt('www.webpagetest.org');23 if (err) return console.error(err);24 console.log('Test status: ' + data.statusText);25 test.getTestResults(data.data.testId, function(err, data) {26 if (err) return console.error(err);27 console.log('First View: ' + data.data.average.firstView.loadTime);28 console.log('Repeat View: ' + data.data.average.repeatView.loadTime);29 });30});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptoolkit = require('wptoolkit');2var fs = require('fs');3var path = require('path');4var util = require('util');5var exec = require('child_process').exec;6var child;7var wptoolkit = require('wptoolkit');8var fs = require('fs');9var path = require('path');10var util = require('util');

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org', 'A.6c9d8f9c0d0e7b1c1f1d8e2e2d3e0f3b');3var url = 'www.google.com';4var options = {5};6wpt.runTest(url, options, function(err, data) {7 if (err) return console.error(err);8 console.log('Test Results: ' + data.data.summary);9});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('./lib/webpagetest');2var wpt = new WebPageTest('localhost', 'A.9d9d7e8c8f1b7c2f1d6b7a8e8c8f7e9c');3var fs = require('fs');4var url = require('url');5var path = require('path');6var async = require('async');7var request = require('request');8var cheerio = require('cheerio');9var mkdirp = require('mkdirp');10var rimraf = require('rimraf');11var spawn = require('child_process').spawn;12var util = require('util');13var ProgressBar = require('progress');14var config = require('./config.json');15var resultsDir = path.join(__dirname, 'results');16];17var testOptions = {

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest-api');2var options = {3};4wpt.runTest(options, function(err, data) {5 if (err) return console.log(err);6 console.log('Test status:', data.statusCode);7 console.log('Test ID:', data.data.testId);8 console.log('Test results available at:', data.data.summaryCSV);9});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful