Revealer.js 764 B

12345
  1. export class Revealer{reveal(object,omitFocus){}}
  2. export const reveal=function(revealable,omitFocus){if(!revealable){return Promise.reject(new Error('Can\'t reveal '+revealable));}
  3. return self.runtime.allInstances(Revealer,revealable).then(reveal);function reveal(revealers){const promises=[];for(let i=0;i<revealers.length;++i){promises.push(revealers[i].reveal((revealable),omitFocus));}
  4. return Promise.race(promises);}};export const revealDestination=function(revealable){const extension=self.runtime.extension(Revealer,revealable);if(!extension){return null;}
  5. return extension.descriptor()['destination'];};self.Common=self.Common||{};Common=Common||{};Common.Revealer=Revealer;Common.Revealer.reveal=reveal;Common.Revealer.revealDestination=revealDestination;