Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Notes on document

Please note, this document is in an early draft form. It’s primary purpose is to discover how we will define APIs, rather than discover the detail of a specific API method. In other words, now is not the time to ask “Why doesn’t it support xyz?”, however, it is a good time to ask “If we were to add xyz, where would it live?”

...

The exact visual style and full functionality of a markup tool is container dependent and hence out-of-scope of this specification.

Constructor

Code Block
languagejs
ScreenSnippet()


Creates a new instance of the ScreenSnippet object.

Syntax

Code Block
languagejs
let mySnippet = new ScreenSnippet();


Note: the API should be exposed as a global namespace - working name "ssf" so:

Code Block
languagejs
let mySnippet = new ssf.ScreenSnippet();

...

ScreenSnippet()

...


Parameters

None.

Methods

Code Block
languagejs
capture()

Creates a new instance of the ScreenSnippet object.

Syntax

Code Block
languagejs
mySnippet.capture().then(function(bitmap) { ... });

Parameters

none

Returns

A Promise that resolves to an ImageBitmap object with contains the captured image and type.

...


Discussion points:

  • (From Gareth) I've assumed we have a preference for promises vs callbacks.  This seems inline with modern HTML5 standards which are deprecating callbacks. 

  • (From Gareth) We should discuss the return object for the capture method.  I've currently followed the Minuet approach.