extensions/amp-story/1.0/amp-story.js
/**
   * @param {number} timeoutMs The maximum amount of time to wait, in
   *     milliseconds.
   * @return {!Promise} A promise that is resolved when the initial content is
   *     loaded or the timeout has been exceeded, whichever happens first.
   * @private
   */
@param {number} timeoutMs The maximum amount of time to wait, in
milliseconds.
@return {!Promise} A promise that is resolved when the initial content is
loaded or the timeout has been exceeded, whichever happens first.
@private
@param { number } timeoutMs The maximum amount of time to wait in milliseconds . @return { !Promise } A promise that is resolved when the initial content is loaded or the timeout has been exceeded whichever happens first . @private
whenInitialContentLoaded_(timeoutMs = 0) {
    const initialPageEl = this.element.querySelector(
      `amp-story-page#${escapeCssSelectorIdent(this.getInitialPageId_())}`
    );
    const storyLoadPromise = whenUpgradedToCustomElement(initialPageEl).then(
      () => {
        return initialPageEl.signals().whenSignal(CommonSignals_Enum.LOAD_END);
      }
    );
    return this.timer_
      .timeoutPromise(timeoutMs, storyLoadPromise)
      .catch(() => {});
  }
whenInitialContentLoaded_ ( timeoutMs = 0 ) { const initialPageEl = this . element . querySelector ( ` ${ escapeCssSelectorIdent ( this . getInitialPageId_ ( ) ) } ` ) ; const storyLoadPromise = whenUpgradedToCustomElement ( initialPageEl ) . then ( ( ) => { return initialPageEl . signals ( ) . whenSignal ( CommonSignals_Enum . LOAD_END ) ; } ) ; return this . timer_ . timeoutPromise ( timeoutMs , storyLoadPromise ) . catch ( ( ) => { } ) ; }
@param {number} timeoutMs The maximum amount of time to wait, in
     milliseconds.
@param { number } timeoutMs The maximum amount of time to wait in milliseconds .