documentation/test/fixture/document-exported.input.js
Erik Arvidsson e11c1ab3b5 Change document-exported to traverse the code (#533)
* Change document-exported to traverse the code

Instead of traversing over all input files this changes
documentExported to traverse from the exports in the input files,
loading, parsing and traversing the module specifier as needed.

Fixes #515

* Move parseToAst to its own module

* Skip non export declarations for speed
2016-09-09 11:07:26 -04:00

66 lines
1.4 KiB
JavaScript

// Options: {"documentExported": true}
export class Class {
classMethod() {}
get classGetter() {}
set classSetter(v) {}
static staticMethod() {}
static get staticGetter() {}
static set staticSetter(v) {}
}
export var object = {
method() {},
get getter() {},
set setter(v) {},
prop: 42,
func: function() {},
};
/** Should not document this */
class NotExportedClass {
/** Should not document this */
classMethod() {}
/** Should not document this */
get classGetter() {}
/** Should not document this */
set classSetter(v) {}
/** Should not document this */
static staticMethod() {}
/** Should not document this */
static get staticGetter() {}
/** Should not document this */
static set staticSetter(v) {}
}
/** Should not document this */
var notExportedObject = {
/** Should not document this */
method() {},
/** Should not document this */
get getter() {},
/** Should not document this */
set setter(v) {},
/** Should not document this */
prop: 42,
/** Should not document this */
func: function() {},
};
export {x, y3 as y4} from './document-exported/x.js';
export z from './document-exported/z.js';
export y2Default from './document-exported/y.js';
function f1() {}
function f2() {}
export {f1, f2 as f3};
export type T = number;
type T2 = string;
type T3 = string;
export type {T2, T3 as T4};
export type {T5} from './document-exported/x.js';