documentation/__tests__/fixture/es6.output-toc.md
Tom MacWright 11d9045a00 Native Flow, use Jest (#767)
* build: Use Flow syntax without comments.

We're switching to Flow annotations - not Flow comments. This
gives documentation.js the ability to self-document without
JSDoc types and improves our compatibility with tools like
prettier.

Fixes #729. Fixes #709
2017-05-08 20:46:21 -04:00

3.6 KiB

destructure

This function destructures with defaults. It should not have any parameter descriptions.

Parameters

  • $0 Object (optional, default {})
    • $0.phoneNumbers (optional, default [])
    • $0.emailAddresses (optional, default [])
    • $0.params ...any

destructure

Similar, but with an array

Parameters

  • $0 Array
    • $0.0
    • $0.1
    • $0.2

Examples

destructure([1, 2, 3])

multiply

This function returns the number one.

Parameters

Returns Number numberone

Sink

This is a sink

Parameters

  • height number the height of the thing
  • width number the width of the thing

staticProp

This is a property of the sink.

empty

Is it empty

aGetter

This is a getter method: it should be documented as a property.

hello

This method says hello

makeABasket

This method returns a basket. The type should not be linked.

Returns Basket a basket

makeASink

This method returns a sink. The type should be linked. It takes a number which should also be linked.

Returns Sink a sink

functionWithRest

This function takes rest params

Parameters

  • someParams ...any

functionWithRestAndType

So does this one, with types

Parameters

foo

This is an async method

es6.input

This function returns the number one.

Returns Number numberone

veryImportantTransform

This tests our support of optional parameters in ES6

Parameters

  • foo (optional, default 'bar')

iAmProtected

A protected function

iAmPublic

A public function

execute

This is re-exported

isArrayEqualWith

Regression check for #498

Parameters

  • array1 Array<T>
  • array2 Array<T>
  • compareFunction function (a: T, b: T): boolean (optional, default (a:T,b:T):boolean=>a===b)

Returns boolean

paramWithMemberType

Regression check for #749

Parameters

  • a atype.property

Returns boolean