@storybook/angular 0.0.0-pr-23609-sha-f47ef339
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +8 -0
- package/README.md +322 -0
- package/dist/builders/build-storybook/index.js +72 -0
- package/dist/builders/build-storybook/index.spec.d.ts +1 -0
- package/dist/builders/build-storybook/index.spec.js +216 -0
- package/dist/builders/build-storybook/schema.json +167 -0
- package/dist/builders/builders.json +14 -0
- package/dist/builders/start-storybook/index.js +93 -0
- package/dist/builders/start-storybook/index.spec.d.ts +1 -0
- package/dist/builders/start-storybook/index.spec.js +215 -0
- package/dist/builders/start-storybook/schema.json +198 -0
- package/dist/builders/utils/error-handler.d.ts +2 -0
- package/dist/builders/utils/error-handler.js +38 -0
- package/dist/builders/utils/run-compodoc.d.ts +6 -0
- package/dist/builders/utils/run-compodoc.js +58 -0
- package/dist/builders/utils/run-compodoc.spec.d.ts +1 -0
- package/dist/builders/utils/run-compodoc.spec.js +86 -0
- package/dist/builders/utils/standalone-options.d.ts +15 -0
- package/dist/builders/utils/standalone-options.js +2 -0
- package/dist/client/angular-beta/AbstractRenderer.d.ts +53 -0
- package/dist/client/angular-beta/AbstractRenderer.js +180 -0
- package/dist/client/angular-beta/CanvasRenderer.d.ts +13 -0
- package/dist/client/angular-beta/CanvasRenderer.js +16 -0
- package/dist/client/angular-beta/ComputesTemplateFromComponent.d.ts +17 -0
- package/dist/client/angular-beta/ComputesTemplateFromComponent.js +132 -0
- package/dist/client/angular-beta/ComputesTemplateFromComponent.test.d.ts +1 -0
- package/dist/client/angular-beta/ComputesTemplateFromComponent.test.js +403 -0
- package/dist/client/angular-beta/DocsRenderer.d.ts +13 -0
- package/dist/client/angular-beta/DocsRenderer.js +40 -0
- package/dist/client/angular-beta/RendererFactory.d.ts +11 -0
- package/dist/client/angular-beta/RendererFactory.js +56 -0
- package/dist/client/angular-beta/RendererFactory.test.d.ts +1 -0
- package/dist/client/angular-beta/RendererFactory.test.js +164 -0
- package/dist/client/angular-beta/StorybookModule.d.ts +8 -0
- package/dist/client/angular-beta/StorybookModule.js +29 -0
- package/dist/client/angular-beta/StorybookModule.test.d.ts +1 -0
- package/dist/client/angular-beta/StorybookModule.test.js +311 -0
- package/dist/client/angular-beta/StorybookProvider.d.ts +5 -0
- package/dist/client/angular-beta/StorybookProvider.js +26 -0
- package/dist/client/angular-beta/StorybookWrapperComponent.d.ts +16 -0
- package/dist/client/angular-beta/StorybookWrapperComponent.js +140 -0
- package/dist/client/angular-beta/__testfixtures__/input.component.d.ts +26 -0
- package/dist/client/angular-beta/__testfixtures__/input.component.js +67 -0
- package/dist/client/angular-beta/__testfixtures__/test.module.d.ts +2 -0
- package/dist/client/angular-beta/__testfixtures__/test.module.js +20 -0
- package/dist/client/angular-beta/utils/NgComponentAnalyzer.d.ts +29 -0
- package/dist/client/angular-beta/utils/NgComponentAnalyzer.js +100 -0
- package/dist/client/angular-beta/utils/NgComponentAnalyzer.test.d.ts +1 -0
- package/dist/client/angular-beta/utils/NgComponentAnalyzer.test.js +374 -0
- package/dist/client/angular-beta/utils/NgModulesAnalyzer.d.ts +6 -0
- package/dist/client/angular-beta/utils/NgModulesAnalyzer.js +41 -0
- package/dist/client/angular-beta/utils/NgModulesAnalyzer.test.d.ts +1 -0
- package/dist/client/angular-beta/utils/NgModulesAnalyzer.test.js +23 -0
- package/dist/client/angular-beta/utils/PropertyExtractor.d.ts +32 -0
- package/dist/client/angular-beta/utils/PropertyExtractor.js +162 -0
- package/dist/client/angular-beta/utils/PropertyExtractor.test.d.ts +1 -0
- package/dist/client/angular-beta/utils/PropertyExtractor.test.js +142 -0
- package/dist/client/config.d.ts +6 -0
- package/dist/client/config.js +10 -0
- package/dist/client/decorateStory.d.ts +4 -0
- package/dist/client/decorateStory.js +49 -0
- package/dist/client/decorateStory.test.d.ts +1 -0
- package/dist/client/decorateStory.test.js +304 -0
- package/dist/client/decorators.d.ts +14 -0
- package/dist/client/decorators.js +70 -0
- package/dist/client/decorators.test.d.ts +1 -0
- package/dist/client/decorators.test.js +146 -0
- package/dist/client/docs/__testfixtures__/doc-button/input.d.ts +111 -0
- package/dist/client/docs/__testfixtures__/doc-button/input.js +207 -0
- package/dist/client/docs/__testfixtures__/doc-button/tsconfig.json +7 -0
- package/dist/client/docs/angular-properties.test.d.ts +1 -0
- package/dist/client/docs/angular-properties.test.js +62 -0
- package/dist/client/docs/compodoc.d.ts +12 -0
- package/dist/client/docs/compodoc.js +258 -0
- package/dist/client/docs/compodoc.test.d.ts +1 -0
- package/dist/client/docs/compodoc.test.js +131 -0
- package/dist/client/docs/config.d.ts +4 -0
- package/dist/client/docs/config.js +19 -0
- package/dist/client/docs/index.d.ts +1 -0
- package/dist/client/docs/index.js +17 -0
- package/dist/client/docs/sourceDecorator.d.ts +9 -0
- package/dist/client/docs/sourceDecorator.js +51 -0
- package/dist/client/docs/types.d.ts +102 -0
- package/dist/client/docs/types.js +2 -0
- package/dist/client/globals.d.ts +23 -0
- package/dist/client/globals.js +40 -0
- package/dist/client/index.d.ts +5 -0
- package/dist/client/index.js +30 -0
- package/dist/client/preview-prod.d.ts +1 -0
- package/dist/client/preview-prod.js +4 -0
- package/dist/client/public-api.d.ts +15 -0
- package/dist/client/public-api.js +36 -0
- package/dist/client/public-types.d.ts +37 -0
- package/dist/client/public-types.js +2 -0
- package/dist/client/render.d.ts +7 -0
- package/dist/client/render.js +19 -0
- package/dist/client/types.d.ts +46 -0
- package/dist/client/types.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +29 -0
- package/dist/index.mjs +13 -0
- package/dist/preset.d.ts +6 -0
- package/dist/preset.js +36 -0
- package/dist/preset.mjs +30 -0
- package/dist/renderer.d.ts +6 -0
- package/dist/renderer.js +15 -0
- package/dist/renderer.mjs +6 -0
- package/dist/server/__mocks-ng-workspace__/empty-projects-entry/angular.json +4 -0
- package/dist/server/__mocks-ng-workspace__/minimal-config/angular.json +18 -0
- package/dist/server/__mocks-ng-workspace__/minimal-config/src/main.d.ts +1 -0
- package/dist/server/__mocks-ng-workspace__/minimal-config/src/main.js +5 -0
- package/dist/server/__mocks-ng-workspace__/minimal-config/src/tsconfig.app.json +9 -0
- package/dist/server/__mocks-ng-workspace__/minimal-config/tsconfig.json +13 -0
- package/dist/server/__mocks-ng-workspace__/some-config/angular.json +19 -0
- package/dist/server/__mocks-ng-workspace__/some-config/src/main.d.ts +1 -0
- package/dist/server/__mocks-ng-workspace__/some-config/src/main.js +5 -0
- package/dist/server/__mocks-ng-workspace__/some-config/src/tsconfig.app.json +9 -0
- package/dist/server/__mocks-ng-workspace__/some-config/tsconfig.json +13 -0
- package/dist/server/__mocks-ng-workspace__/with-angularBrowserTarget/angular.json +64 -0
- package/dist/server/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.d.ts +1 -0
- package/dist/server/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.js +5 -0
- package/dist/server/__mocks-ng-workspace__/with-angularBrowserTarget/src/tsconfig.app.json +9 -0
- package/dist/server/__mocks-ng-workspace__/with-angularBrowserTarget/tsconfig.json +13 -0
- package/dist/server/__mocks-ng-workspace__/with-lib/angular.json +28 -0
- package/dist/server/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.d.ts +1 -0
- package/dist/server/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.js +5 -0
- package/dist/server/__mocks-ng-workspace__/with-lib/projects/pattern-lib/tsconfig.lib.json +20 -0
- package/dist/server/__mocks-ng-workspace__/with-lib/tsconfig.json +13 -0
- package/dist/server/__mocks-ng-workspace__/with-nx/angular.json +18 -0
- package/dist/server/__mocks-ng-workspace__/with-nx/nx.json +3 -0
- package/dist/server/__mocks-ng-workspace__/with-nx/src/main.d.ts +1 -0
- package/dist/server/__mocks-ng-workspace__/with-nx/src/main.js +5 -0
- package/dist/server/__mocks-ng-workspace__/with-nx/src/tsconfig.app.json +8 -0
- package/dist/server/__mocks-ng-workspace__/with-nx/tsconfig.json +14 -0
- package/dist/server/__mocks-ng-workspace__/with-nx-workspace/nx.json +3 -0
- package/dist/server/__mocks-ng-workspace__/with-nx-workspace/src/main.d.ts +1 -0
- package/dist/server/__mocks-ng-workspace__/with-nx-workspace/src/main.js +5 -0
- package/dist/server/__mocks-ng-workspace__/with-nx-workspace/src/tsconfig.app.json +8 -0
- package/dist/server/__mocks-ng-workspace__/with-nx-workspace/tsconfig.json +14 -0
- package/dist/server/__mocks-ng-workspace__/with-nx-workspace/workspace.json +18 -0
- package/dist/server/__mocks-ng-workspace__/with-options-styles/angular.json +18 -0
- package/dist/server/__mocks-ng-workspace__/with-options-styles/src/main.d.ts +1 -0
- package/dist/server/__mocks-ng-workspace__/with-options-styles/src/main.js +5 -0
- package/dist/server/__mocks-ng-workspace__/with-options-styles/src/tsconfig.app.json +9 -0
- package/dist/server/__mocks-ng-workspace__/with-options-styles/tsconfig.json +13 -0
- package/dist/server/__mocks-ng-workspace__/without-architect-build/angular.json +5 -0
- package/dist/server/__mocks-ng-workspace__/without-architect-build-options/angular.json +11 -0
- package/dist/server/__mocks-ng-workspace__/without-compatible-projects/angular.json +7 -0
- package/dist/server/__mocks-ng-workspace__/without-projects-entry/angular.json +3 -0
- package/dist/server/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/src/main.d.ts +1 -0
- package/dist/server/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/src/main.js +5 -0
- package/dist/server/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/tsconfig.lib.json +20 -0
- package/dist/server/__mocks-ng-workspace__/without-projects-entry/tsconfig.json +13 -0
- package/dist/server/__mocks-ng-workspace__/without-tsConfig/angular.json +16 -0
- package/dist/server/__mocks-ng-workspace__/without-tsConfig/src/main.d.ts +1 -0
- package/dist/server/__mocks-ng-workspace__/without-tsConfig/src/main.js +5 -0
- package/dist/server/__mocks-ng-workspace__/without-tsConfig/src/tsconfig.app.json +9 -0
- package/dist/server/__mocks-ng-workspace__/without-tsConfig/tsconfig.json +13 -0
- package/dist/server/__tests__/angular.json +96 -0
- package/dist/server/angular-cli-webpack.d.ts +1 -0
- package/dist/server/angular-cli-webpack.js +99 -0
- package/dist/server/framework-preset-angular-cli.d.ts +4 -0
- package/dist/server/framework-preset-angular-cli.js +85 -0
- package/dist/server/framework-preset-angular-docs.d.ts +2 -0
- package/dist/server/framework-preset-angular-docs.js +10 -0
- package/dist/server/framework-preset-angular-ivy.d.ts +10 -0
- package/dist/server/framework-preset-angular-ivy.js +103 -0
- package/dist/server/plugins/storybook-normalize-angular-entry-plugin.d.ts +25 -0
- package/dist/server/plugins/storybook-normalize-angular-entry-plugin.js +48 -0
- package/dist/server/preset-options.d.ts +13 -0
- package/dist/server/preset-options.js +2 -0
- package/dist/server/utils/filter-out-styling-rules.d.ts +2 -0
- package/dist/server/utils/filter-out-styling-rules.js +17 -0
- package/dist/server/utils/module-is-available.d.ts +1 -0
- package/dist/server/utils/module-is-available.js +13 -0
- package/dist/types.d.ts +29 -0
- package/dist/types.js +2 -0
- package/dist/types.mjs +1 -0
- package/jest.config.js +31 -0
- package/package.json +126 -0
- package/preset.js +1 -0
- package/renderer.d.ts +1 -0
- package/renderer.js +1 -0
- package/src/server/angular-cli-webpack.d.ts +7 -0
- package/src/server/angular-cli-webpack.js +127 -0
- package/src/server/plugins/storybook-normalize-angular-entry-plugin.js +54 -0
- package/src/typings.d.ts +21 -0
- package/template/cli/.eslintrc.json +5 -0
- package/template/cli/Button.stories.ts +51 -0
- package/template/cli/Header.stories.ts +37 -0
- package/template/cli/Page.stories.ts +46 -0
- package/template/cli/User.ts +2 -0
- package/template/cli/button.component.ts +55 -0
- package/template/cli/header.component.ts +75 -0
- package/template/cli/page.component.ts +77 -0
- package/template/components/button.component.ts +54 -0
- package/template/components/button.css +30 -0
- package/template/components/form.component.ts +37 -0
- package/template/components/html.component.ts +22 -0
- package/template/components/index.js +8 -0
- package/template/components/pre.component.ts +29 -0
- package/template/stories/angular-mdx.stories.mdx +25 -0
- package/template/stories/argTypes/doc-button/doc-button.component.html +7 -0
- package/template/stories/argTypes/doc-button/doc-button.component.scss +3 -0
- package/template/stories/argTypes/doc-button/doc-button.component.ts +232 -0
- package/template/stories/argTypes/doc-button/doc-button.stories.ts +24 -0
- package/template/stories/argTypes/doc-directive/doc-directive.directive.ts +24 -0
- package/template/stories/argTypes/doc-directive/doc-directive.stories.ts +14 -0
- package/template/stories/argTypes/doc-injectable/doc-injectable.service.ts +27 -0
- package/template/stories/argTypes/doc-injectable/doc-injectable.stories.ts +17 -0
- package/template/stories/argTypes/doc-pipe/doc-pipe.pipe.ts +18 -0
- package/template/stories/argTypes/doc-pipe/doc-pipe.stories.ts +17 -0
- package/template/stories/basics/README.stories.mdx +7 -0
- package/template/stories/basics/angular-forms/customControlValueAccessor/custom-cva-component.stories.ts +27 -0
- package/template/stories/basics/angular-forms/customControlValueAccessor/custom-cva.component.ts +57 -0
- package/template/stories/basics/component-with-complex-selectors/attribute-selector.component.ts +19 -0
- package/template/stories/basics/component-with-complex-selectors/attribute-selectors.component.stories.ts +8 -0
- package/template/stories/basics/component-with-complex-selectors/class-selector.component.stories.ts +8 -0
- package/template/stories/basics/component-with-complex-selectors/class-selector.component.ts +19 -0
- package/template/stories/basics/component-with-complex-selectors/multiple-class-selector.component.stories.ts +8 -0
- package/template/stories/basics/component-with-complex-selectors/multiple-selector.component.stories.ts +8 -0
- package/template/stories/basics/component-with-complex-selectors/multiple-selector.component.ts +37 -0
- package/template/stories/basics/component-with-enums/enums.component.html +8 -0
- package/template/stories/basics/component-with-enums/enums.component.stories.ts +24 -0
- package/template/stories/basics/component-with-enums/enums.component.ts +53 -0
- package/template/stories/basics/component-with-inheritance/base-button.component.ts +10 -0
- package/template/stories/basics/component-with-inheritance/base-button.stories.ts +12 -0
- package/template/stories/basics/component-with-inheritance/icon-button.component.ts +11 -0
- package/template/stories/basics/component-with-inheritance/icon-button.stories.ts +13 -0
- package/template/stories/basics/component-with-ng-content/ng-content-about-parent.stories.ts +58 -0
- package/template/stories/basics/component-with-ng-content/ng-content-simple.stories.ts +29 -0
- package/template/stories/basics/component-with-ng-on-destroy/component-with-on-destroy.stories.ts +40 -0
- package/template/stories/basics/component-with-on-push/on-push-box.component.ts +21 -0
- package/template/stories/basics/component-with-on-push/on-push.stories.ts +21 -0
- package/template/stories/basics/component-with-pipe/custom-pipes.stories.ts +31 -0
- package/template/stories/basics/component-with-pipe/custom.pipe.ts +10 -0
- package/template/stories/basics/component-with-pipe/with-pipe.component.ts +10 -0
- package/template/stories/basics/component-with-provider/di.component.html +7 -0
- package/template/stories/basics/component-with-provider/di.component.stories.ts +26 -0
- package/template/stories/basics/component-with-provider/di.component.ts +28 -0
- package/template/stories/basics/component-with-style/styled.component.css +3 -0
- package/template/stories/basics/component-with-style/styled.component.html +5 -0
- package/template/stories/basics/component-with-style/styled.component.scss +5 -0
- package/template/stories/basics/component-with-style/styled.component.stories.ts +10 -0
- package/template/stories/basics/component-with-style/styled.component.ts +8 -0
- package/template/stories/basics/component-without-selector/without-selector-ng-component-outlet.stories.ts +73 -0
- package/template/stories/basics/component-without-selector/without-selector-ng-factory-resolver.stories.ts +71 -0
- package/template/stories/basics/component-without-selector/without-selector.component.ts +30 -0
- package/template/stories/basics/component-without-selector/without-selector.stories.ts +30 -0
- package/template/stories/basics/ng-module/angular-src/chip-color.token.ts +3 -0
- package/template/stories/basics/ng-module/angular-src/chip-text.pipe.ts +29 -0
- package/template/stories/basics/ng-module/angular-src/chip.component.ts +60 -0
- package/template/stories/basics/ng-module/angular-src/chips-group.component.ts +49 -0
- package/template/stories/basics/ng-module/angular-src/chips.module.ts +31 -0
- package/template/stories/basics/ng-module/import-module-chip.stories.ts +23 -0
- package/template/stories/basics/ng-module/import-module-for-root.stories.ts +50 -0
- package/template/stories/basics/ng-module/import-module.stories.ts +35 -0
- package/template/stories/button.component.ts +26 -0
- package/template/stories/core/README.stories.mdx +7 -0
- package/template/stories/core/applicationConfig/with-browser-animations.stories.ts +40 -0
- package/template/stories/core/applicationConfig/with-noop-browser-animations.stories.ts +35 -0
- package/template/stories/core/decorators/componentWrapperDecorator/child.component.ts +20 -0
- package/template/stories/core/decorators/componentWrapperDecorator/decorators.stories.ts +99 -0
- package/template/stories/core/decorators/componentWrapperDecorator/parent.component.ts +18 -0
- package/template/stories/core/decorators/theme-decorator/decorators.stories.ts +20 -0
- package/template/stories/core/moduleMetadata/angular-src/custom.pipe.ts +10 -0
- package/template/stories/core/moduleMetadata/angular-src/dummy.service.ts +14 -0
- package/template/stories/core/moduleMetadata/angular-src/open-close-component/open-close.component.css +13 -0
- package/template/stories/core/moduleMetadata/angular-src/open-close-component/open-close.component.html +7 -0
- package/template/stories/core/moduleMetadata/angular-src/open-close-component/open-close.component.ts +39 -0
- package/template/stories/core/moduleMetadata/angular-src/service.component.ts +24 -0
- package/template/stories/core/moduleMetadata/angular-src/token.component.ts +31 -0
- package/template/stories/core/moduleMetadata/in-export-default.stories.ts +38 -0
- package/template/stories/core/moduleMetadata/in-stories.stories.ts +46 -0
- package/template/stories/core/moduleMetadata/merge-default-and-story.stories.ts +35 -0
- package/template/stories/core/parameters/bootstrap-options.stories.ts +18 -0
- package/template/stories/core/styles/story-styles.stories.ts +50 -0
- package/template/stories/others/app-initializer-use-factory/app-initializer-use-factory.stories.ts +34 -0
- package/template/stories/others/issues/12009-unknown-component.stories.ts +14 -0
- package/template/stories/others/ngx-translate/README.stories.mdx +65 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const core_1 = require("@angular/core");
|
|
10
|
+
const decorators_1 = require("./decorators");
|
|
11
|
+
const defaultContext = {
|
|
12
|
+
componentId: 'unspecified',
|
|
13
|
+
kind: 'unspecified',
|
|
14
|
+
title: 'unspecified',
|
|
15
|
+
id: 'unspecified',
|
|
16
|
+
name: 'unspecified',
|
|
17
|
+
story: 'unspecified',
|
|
18
|
+
tags: [],
|
|
19
|
+
parameters: {},
|
|
20
|
+
initialArgs: {},
|
|
21
|
+
args: {},
|
|
22
|
+
argTypes: {},
|
|
23
|
+
globals: {},
|
|
24
|
+
hooks: {},
|
|
25
|
+
loaded: {},
|
|
26
|
+
originalStoryFn: jest.fn(),
|
|
27
|
+
viewMode: 'story',
|
|
28
|
+
abortSignal: undefined,
|
|
29
|
+
canvasElement: undefined,
|
|
30
|
+
};
|
|
31
|
+
class MockModule {
|
|
32
|
+
}
|
|
33
|
+
class MockModuleTwo {
|
|
34
|
+
}
|
|
35
|
+
class MockService {
|
|
36
|
+
}
|
|
37
|
+
let MockComponent = class MockComponent {
|
|
38
|
+
};
|
|
39
|
+
MockComponent = __decorate([
|
|
40
|
+
(0, core_1.Component)({})
|
|
41
|
+
], MockComponent);
|
|
42
|
+
describe('applicationConfig', () => {
|
|
43
|
+
const provider1 = () => { };
|
|
44
|
+
const provider2 = () => { };
|
|
45
|
+
it('should apply global config', () => {
|
|
46
|
+
expect((0, decorators_1.applicationConfig)({
|
|
47
|
+
providers: [provider1],
|
|
48
|
+
})(() => ({}), defaultContext)).toEqual({
|
|
49
|
+
applicationConfig: {
|
|
50
|
+
providers: [provider1],
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
it('should apply story config', () => {
|
|
55
|
+
expect((0, decorators_1.applicationConfig)({
|
|
56
|
+
providers: [],
|
|
57
|
+
})(() => ({
|
|
58
|
+
applicationConfig: {
|
|
59
|
+
providers: [provider2],
|
|
60
|
+
},
|
|
61
|
+
}), {
|
|
62
|
+
...defaultContext,
|
|
63
|
+
})).toEqual({
|
|
64
|
+
applicationConfig: {
|
|
65
|
+
providers: [provider2],
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
it('should merge global and story config', () => {
|
|
70
|
+
expect((0, decorators_1.applicationConfig)({
|
|
71
|
+
providers: [provider1],
|
|
72
|
+
})(() => ({
|
|
73
|
+
applicationConfig: {
|
|
74
|
+
providers: [provider2],
|
|
75
|
+
},
|
|
76
|
+
}), {
|
|
77
|
+
...defaultContext,
|
|
78
|
+
})).toEqual({
|
|
79
|
+
applicationConfig: {
|
|
80
|
+
providers: [provider1, provider2],
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
describe('moduleMetadata', () => {
|
|
86
|
+
it('should add metadata to a story without it', () => {
|
|
87
|
+
const result = (0, decorators_1.moduleMetadata)({
|
|
88
|
+
imports: [MockModule],
|
|
89
|
+
providers: [MockService],
|
|
90
|
+
})(() => ({}),
|
|
91
|
+
// deepscan-disable-next-line
|
|
92
|
+
defaultContext);
|
|
93
|
+
expect(result).toEqual({
|
|
94
|
+
moduleMetadata: {
|
|
95
|
+
declarations: [],
|
|
96
|
+
entryComponents: [],
|
|
97
|
+
imports: [MockModule],
|
|
98
|
+
schemas: [],
|
|
99
|
+
providers: [MockService],
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
it('should combine with individual metadata on a story', () => {
|
|
104
|
+
const result = (0, decorators_1.moduleMetadata)({
|
|
105
|
+
imports: [MockModule],
|
|
106
|
+
})(() => ({
|
|
107
|
+
component: MockComponent,
|
|
108
|
+
moduleMetadata: {
|
|
109
|
+
imports: [MockModuleTwo],
|
|
110
|
+
providers: [MockService],
|
|
111
|
+
},
|
|
112
|
+
}),
|
|
113
|
+
// deepscan-disable-next-line
|
|
114
|
+
defaultContext);
|
|
115
|
+
expect(result).toEqual({
|
|
116
|
+
component: MockComponent,
|
|
117
|
+
moduleMetadata: {
|
|
118
|
+
declarations: [],
|
|
119
|
+
entryComponents: [],
|
|
120
|
+
imports: [MockModule, MockModuleTwo],
|
|
121
|
+
schemas: [],
|
|
122
|
+
providers: [MockService],
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
it('should return the original metadata if passed null', () => {
|
|
127
|
+
const result = (0, decorators_1.moduleMetadata)(null)(() => ({
|
|
128
|
+
component: MockComponent,
|
|
129
|
+
moduleMetadata: {
|
|
130
|
+
providers: [MockService],
|
|
131
|
+
},
|
|
132
|
+
}),
|
|
133
|
+
// deepscan-disable-next-line
|
|
134
|
+
defaultContext);
|
|
135
|
+
expect(result).toEqual({
|
|
136
|
+
component: MockComponent,
|
|
137
|
+
moduleMetadata: {
|
|
138
|
+
declarations: [],
|
|
139
|
+
entryComponents: [],
|
|
140
|
+
imports: [],
|
|
141
|
+
schemas: [],
|
|
142
|
+
providers: [MockService],
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
});
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { EventEmitter, ElementRef } from '@angular/core';
|
|
2
|
+
export declare const exportedConstant = "An exported constant";
|
|
3
|
+
export type ButtonSize = 'small' | 'medium' | 'large' | 'xlarge';
|
|
4
|
+
export declare enum ButtonAccent {
|
|
5
|
+
'Normal' = "Normal",
|
|
6
|
+
'High' = "High"
|
|
7
|
+
}
|
|
8
|
+
export interface ISomeInterface {
|
|
9
|
+
one: string;
|
|
10
|
+
two: boolean;
|
|
11
|
+
three: any[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* This is a simple button that demonstrates various JSDoc handling in Storybook Docs for Angular.
|
|
15
|
+
*
|
|
16
|
+
* It supports [markdown](https://en.wikipedia.org/wiki/Markdown), so you can embed formatted text,
|
|
17
|
+
* like **bold**, _italic_, and `inline code`.
|
|
18
|
+
*
|
|
19
|
+
* > How you like dem apples?! It's never been easier to document all your components.
|
|
20
|
+
*
|
|
21
|
+
* @string Hello world
|
|
22
|
+
* @link [Example](http://example.com)
|
|
23
|
+
* @code `ThingThing`
|
|
24
|
+
* @html <span class="badge">aaa</span>
|
|
25
|
+
*/
|
|
26
|
+
export declare class InputComponent<T> {
|
|
27
|
+
buttonRef: ElementRef;
|
|
28
|
+
/** Appearance style of the button. */
|
|
29
|
+
appearance: 'primary' | 'secondary';
|
|
30
|
+
/** Specify the accent-type of the button */
|
|
31
|
+
accent: ButtonAccent;
|
|
32
|
+
/** Sets the button to a disabled state. */
|
|
33
|
+
isDisabled: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The inner text of the button.
|
|
36
|
+
*
|
|
37
|
+
* @required
|
|
38
|
+
*/
|
|
39
|
+
label: string;
|
|
40
|
+
/** Size of the button. */
|
|
41
|
+
size?: ButtonSize;
|
|
42
|
+
/** Specifies some arbitrary object */
|
|
43
|
+
someDataObject: ISomeInterface;
|
|
44
|
+
/**
|
|
45
|
+
* Some input you shouldn't use.
|
|
46
|
+
*
|
|
47
|
+
* @deprecated
|
|
48
|
+
*/
|
|
49
|
+
somethingYouShouldNotUse: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Handler to be called when the button is clicked by a user.
|
|
52
|
+
*
|
|
53
|
+
* Will also block the emission of the event if `isDisabled` is true.
|
|
54
|
+
*/
|
|
55
|
+
onClick: EventEmitter<Event>;
|
|
56
|
+
/**
|
|
57
|
+
* This is an internal method that we don't want to document and have added the `ignore` annotation to.
|
|
58
|
+
*
|
|
59
|
+
* @ignore
|
|
60
|
+
*/
|
|
61
|
+
handleClick(event: Event): void;
|
|
62
|
+
private _inputValue;
|
|
63
|
+
/** Setter for `inputValue` that is also an `@Input`. */
|
|
64
|
+
set inputValue(value: string);
|
|
65
|
+
/** Getter for `inputValue`. */
|
|
66
|
+
get inputValue(): string;
|
|
67
|
+
onClickListener(btn: any): void;
|
|
68
|
+
focus: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Returns all the CSS classes for the button.
|
|
71
|
+
*
|
|
72
|
+
* @ignore
|
|
73
|
+
*/
|
|
74
|
+
get classes(): string[];
|
|
75
|
+
/**
|
|
76
|
+
* @ignore
|
|
77
|
+
*/
|
|
78
|
+
ignoredProperty: string;
|
|
79
|
+
/** Public value. */
|
|
80
|
+
internalProperty: string;
|
|
81
|
+
/** Private value. */
|
|
82
|
+
private _value;
|
|
83
|
+
/** Set the private value. */
|
|
84
|
+
set value(value: string | number);
|
|
85
|
+
/** Get the private value. */
|
|
86
|
+
get value(): string | number;
|
|
87
|
+
/**
|
|
88
|
+
* An internal calculation method which adds `x` and `y` together.
|
|
89
|
+
*
|
|
90
|
+
* @param x Some number you'd like to use.
|
|
91
|
+
* @param y Some other number or string you'd like to use, will have `parseInt()` applied before calculation.
|
|
92
|
+
*/
|
|
93
|
+
calc(x: number, y: string | number): number;
|
|
94
|
+
/** A public method using an interface. */
|
|
95
|
+
publicMethod(things: ISomeInterface): void;
|
|
96
|
+
/**
|
|
97
|
+
* A protected method.
|
|
98
|
+
*
|
|
99
|
+
* @param id Some `id`.
|
|
100
|
+
*/
|
|
101
|
+
protected protectedMethod(id?: number): void;
|
|
102
|
+
/**
|
|
103
|
+
* A private method.
|
|
104
|
+
*
|
|
105
|
+
* @param password Some `password`.
|
|
106
|
+
*/
|
|
107
|
+
private privateMethod;
|
|
108
|
+
showKey: keyof T;
|
|
109
|
+
set item(item: T[]);
|
|
110
|
+
processedItem: T[];
|
|
111
|
+
}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.InputComponent = exports.ButtonAccent = exports.exportedConstant = void 0;
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
14
|
+
// @ts-nocheck
|
|
15
|
+
/* eslint-disable no-console */
|
|
16
|
+
/* eslint-disable no-underscore-dangle */
|
|
17
|
+
const core_1 = require("@angular/core");
|
|
18
|
+
exports.exportedConstant = 'An exported constant';
|
|
19
|
+
var ButtonAccent;
|
|
20
|
+
(function (ButtonAccent) {
|
|
21
|
+
ButtonAccent["Normal"] = "Normal";
|
|
22
|
+
ButtonAccent["High"] = "High";
|
|
23
|
+
})(ButtonAccent = exports.ButtonAccent || (exports.ButtonAccent = {}));
|
|
24
|
+
/**
|
|
25
|
+
* This is a simple button that demonstrates various JSDoc handling in Storybook Docs for Angular.
|
|
26
|
+
*
|
|
27
|
+
* It supports [markdown](https://en.wikipedia.org/wiki/Markdown), so you can embed formatted text,
|
|
28
|
+
* like **bold**, _italic_, and `inline code`.
|
|
29
|
+
*
|
|
30
|
+
* > How you like dem apples?! It's never been easier to document all your components.
|
|
31
|
+
*
|
|
32
|
+
* @string Hello world
|
|
33
|
+
* @link [Example](http://example.com)
|
|
34
|
+
* @code `ThingThing`
|
|
35
|
+
* @html <span class="badge">aaa</span>
|
|
36
|
+
*/
|
|
37
|
+
let InputComponent = class InputComponent {
|
|
38
|
+
constructor() {
|
|
39
|
+
/** Appearance style of the button. */
|
|
40
|
+
this.appearance = 'secondary';
|
|
41
|
+
/** Sets the button to a disabled state. */
|
|
42
|
+
this.isDisabled = false;
|
|
43
|
+
/** Size of the button. */
|
|
44
|
+
this.size = 'medium';
|
|
45
|
+
/**
|
|
46
|
+
* Some input you shouldn't use.
|
|
47
|
+
*
|
|
48
|
+
* @deprecated
|
|
49
|
+
*/
|
|
50
|
+
this.somethingYouShouldNotUse = false;
|
|
51
|
+
/**
|
|
52
|
+
* Handler to be called when the button is clicked by a user.
|
|
53
|
+
*
|
|
54
|
+
* Will also block the emission of the event if `isDisabled` is true.
|
|
55
|
+
*/
|
|
56
|
+
this.onClick = new core_1.EventEmitter();
|
|
57
|
+
this._inputValue = 'some value';
|
|
58
|
+
this.focus = false;
|
|
59
|
+
/**
|
|
60
|
+
* @ignore
|
|
61
|
+
*/
|
|
62
|
+
this.ignoredProperty = 'Ignore me';
|
|
63
|
+
/** Public value. */
|
|
64
|
+
this.internalProperty = 'Public hello';
|
|
65
|
+
/** Private value. */
|
|
66
|
+
this._value = 'Private hello';
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* This is an internal method that we don't want to document and have added the `ignore` annotation to.
|
|
70
|
+
*
|
|
71
|
+
* @ignore
|
|
72
|
+
*/
|
|
73
|
+
handleClick(event) {
|
|
74
|
+
event.stopPropagation();
|
|
75
|
+
if (!this.isDisabled) {
|
|
76
|
+
this.onClick.emit(event);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/** Setter for `inputValue` that is also an `@Input`. */
|
|
80
|
+
set inputValue(value) {
|
|
81
|
+
this._inputValue = value;
|
|
82
|
+
}
|
|
83
|
+
/** Getter for `inputValue`. */
|
|
84
|
+
get inputValue() {
|
|
85
|
+
return this._inputValue;
|
|
86
|
+
}
|
|
87
|
+
onClickListener(btn) {
|
|
88
|
+
console.log('button', btn);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Returns all the CSS classes for the button.
|
|
92
|
+
*
|
|
93
|
+
* @ignore
|
|
94
|
+
*/
|
|
95
|
+
get classes() {
|
|
96
|
+
return [this.appearance, this.size]
|
|
97
|
+
.filter((_class) => !!_class)
|
|
98
|
+
.map((_class) => `btn-${_class}`);
|
|
99
|
+
}
|
|
100
|
+
/** Set the private value. */
|
|
101
|
+
set value(value) {
|
|
102
|
+
this._value = `${value}`;
|
|
103
|
+
}
|
|
104
|
+
/** Get the private value. */
|
|
105
|
+
get value() {
|
|
106
|
+
return this._value;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* An internal calculation method which adds `x` and `y` together.
|
|
110
|
+
*
|
|
111
|
+
* @param x Some number you'd like to use.
|
|
112
|
+
* @param y Some other number or string you'd like to use, will have `parseInt()` applied before calculation.
|
|
113
|
+
*/
|
|
114
|
+
calc(x, y) {
|
|
115
|
+
return x + parseInt(`${y}`, 10);
|
|
116
|
+
}
|
|
117
|
+
/** A public method using an interface. */
|
|
118
|
+
publicMethod(things) {
|
|
119
|
+
console.log(things);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* A protected method.
|
|
123
|
+
*
|
|
124
|
+
* @param id Some `id`.
|
|
125
|
+
*/
|
|
126
|
+
protectedMethod(id) {
|
|
127
|
+
console.log(id);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* A private method.
|
|
131
|
+
*
|
|
132
|
+
* @param password Some `password`.
|
|
133
|
+
*/
|
|
134
|
+
privateMethod(password) {
|
|
135
|
+
console.log(password);
|
|
136
|
+
}
|
|
137
|
+
set item(item) {
|
|
138
|
+
this.processedItem = item;
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
__decorate([
|
|
142
|
+
(0, core_1.ViewChild)('buttonRef', { static: false }),
|
|
143
|
+
__metadata("design:type", core_1.ElementRef)
|
|
144
|
+
], InputComponent.prototype, "buttonRef", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, core_1.Input)(),
|
|
147
|
+
__metadata("design:type", String)
|
|
148
|
+
], InputComponent.prototype, "appearance", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
(0, core_1.Input)(),
|
|
151
|
+
__metadata("design:type", String)
|
|
152
|
+
], InputComponent.prototype, "accent", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
(0, core_1.Input)(),
|
|
155
|
+
__metadata("design:type", Object)
|
|
156
|
+
], InputComponent.prototype, "isDisabled", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
(0, core_1.Input)(),
|
|
159
|
+
__metadata("design:type", String)
|
|
160
|
+
], InputComponent.prototype, "label", void 0);
|
|
161
|
+
__decorate([
|
|
162
|
+
(0, core_1.Input)(),
|
|
163
|
+
__metadata("design:type", String)
|
|
164
|
+
], InputComponent.prototype, "size", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
(0, core_1.Input)(),
|
|
167
|
+
__metadata("design:type", Object)
|
|
168
|
+
], InputComponent.prototype, "someDataObject", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
(0, core_1.Input)(),
|
|
171
|
+
__metadata("design:type", Object)
|
|
172
|
+
], InputComponent.prototype, "somethingYouShouldNotUse", void 0);
|
|
173
|
+
__decorate([
|
|
174
|
+
(0, core_1.Output)(),
|
|
175
|
+
__metadata("design:type", Object)
|
|
176
|
+
], InputComponent.prototype, "onClick", void 0);
|
|
177
|
+
__decorate([
|
|
178
|
+
(0, core_1.Input)(),
|
|
179
|
+
__metadata("design:type", String),
|
|
180
|
+
__metadata("design:paramtypes", [String])
|
|
181
|
+
], InputComponent.prototype, "inputValue", null);
|
|
182
|
+
__decorate([
|
|
183
|
+
(0, core_1.HostListener)('click', ['$event.target']),
|
|
184
|
+
__metadata("design:type", Function),
|
|
185
|
+
__metadata("design:paramtypes", [Object]),
|
|
186
|
+
__metadata("design:returntype", void 0)
|
|
187
|
+
], InputComponent.prototype, "onClickListener", null);
|
|
188
|
+
__decorate([
|
|
189
|
+
(0, core_1.HostBinding)('class.focused'),
|
|
190
|
+
__metadata("design:type", Object)
|
|
191
|
+
], InputComponent.prototype, "focus", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
(0, core_1.Input)('showKeyAlias'),
|
|
194
|
+
__metadata("design:type", Object)
|
|
195
|
+
], InputComponent.prototype, "showKey", void 0);
|
|
196
|
+
__decorate([
|
|
197
|
+
(0, core_1.Input)(),
|
|
198
|
+
__metadata("design:type", Array),
|
|
199
|
+
__metadata("design:paramtypes", [Array])
|
|
200
|
+
], InputComponent.prototype, "item", null);
|
|
201
|
+
InputComponent = __decorate([
|
|
202
|
+
(0, core_1.Component)({
|
|
203
|
+
selector: 'doc-button',
|
|
204
|
+
template: '<button>{{ label }}</button>',
|
|
205
|
+
})
|
|
206
|
+
], InputComponent);
|
|
207
|
+
exports.InputComponent = InputComponent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'jest-specific-snapshot';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
require("jest-specific-snapshot");
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const tmp_1 = __importDefault(require("tmp"));
|
|
10
|
+
const cross_spawn_1 = require("cross-spawn");
|
|
11
|
+
// @ts-expect-error (Converted from ts-ignore)
|
|
12
|
+
const { SNAPSHOT_OS } = global;
|
|
13
|
+
// File hierarchy: __testfixtures__ / some-test-case / input.*
|
|
14
|
+
const inputRegExp = /^input\..*$/;
|
|
15
|
+
const runCompodoc = (inputPath) => {
|
|
16
|
+
const testDir = path_1.default.dirname(inputPath);
|
|
17
|
+
const { name: tmpDir, removeCallback } = tmp_1.default.dirSync();
|
|
18
|
+
// FIXME: for now, this requires a tsconfig.json for each test case. Tried generating
|
|
19
|
+
// one dynamically in tmpDir, but compodoc doesn't handle absolute paths properly
|
|
20
|
+
// (and screwed around with relative paths as well, but couldn't get it working)
|
|
21
|
+
(0, cross_spawn_1.sync)('yarn', ['compodoc', '-p', `${testDir}/tsconfig.json`, '-e', 'json', '-d', tmpDir], {
|
|
22
|
+
stdio: 'inherit',
|
|
23
|
+
shell: true,
|
|
24
|
+
});
|
|
25
|
+
const output = fs_1.default.readFileSync(`${tmpDir}/documentation.json`, 'utf8');
|
|
26
|
+
try {
|
|
27
|
+
removeCallback();
|
|
28
|
+
}
|
|
29
|
+
catch (e) {
|
|
30
|
+
//
|
|
31
|
+
}
|
|
32
|
+
return output;
|
|
33
|
+
};
|
|
34
|
+
describe('angular component properties', () => {
|
|
35
|
+
const fixturesDir = path_1.default.join(__dirname, '__testfixtures__');
|
|
36
|
+
fs_1.default.readdirSync(fixturesDir, { withFileTypes: true }).forEach((testEntry) => {
|
|
37
|
+
if (testEntry.isDirectory()) {
|
|
38
|
+
const testDir = path_1.default.join(fixturesDir, testEntry.name);
|
|
39
|
+
const testFile = fs_1.default.readdirSync(testDir).find((fileName) => inputRegExp.test(fileName));
|
|
40
|
+
if (testFile) {
|
|
41
|
+
// TODO: Remove this as soon as the real test is fixed
|
|
42
|
+
it('true', () => {
|
|
43
|
+
expect(true).toEqual(true);
|
|
44
|
+
});
|
|
45
|
+
// TODO: Fix this test
|
|
46
|
+
// it(`${testEntry.name}`, () => {
|
|
47
|
+
// const inputPath = path.join(testDir, testFile);
|
|
48
|
+
// // snapshot the output of compodoc
|
|
49
|
+
// const compodocOutput = runCompodoc(inputPath);
|
|
50
|
+
// const compodocJson = JSON.parse(compodocOutput);
|
|
51
|
+
// expect(compodocJson).toMatchSpecificSnapshot(
|
|
52
|
+
// path.join(testDir, `compodoc-${SNAPSHOT_OS}.snapshot`)
|
|
53
|
+
// );
|
|
54
|
+
// // snapshot the output of addon-docs angular-properties
|
|
55
|
+
// const componentData = findComponentByName('InputComponent', compodocJson);
|
|
56
|
+
// const argTypes = extractArgTypesFromData(componentData);
|
|
57
|
+
// expect(argTypes).toMatchSpecificSnapshot(path.join(testDir, 'argtypes.snapshot'));
|
|
58
|
+
// });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ArgTypes, SBType } from '@storybook/types';
|
|
2
|
+
import { Class, CompodocJson, Component, Injectable, Method, Pipe, Property, Directive } from './types';
|
|
3
|
+
export declare const isMethod: (methodOrProp: Method | Property) => methodOrProp is Method;
|
|
4
|
+
export declare const setCompodocJson: (compodocJson: CompodocJson) => void;
|
|
5
|
+
export declare const getCompodocJson: () => CompodocJson;
|
|
6
|
+
export declare const checkValidComponentOrDirective: (component: Component | Directive) => void;
|
|
7
|
+
export declare const checkValidCompodocJson: (compodocJson: CompodocJson) => void;
|
|
8
|
+
export declare const findComponentByName: (name: string, compodocJson: CompodocJson) => Class | Injectable | Pipe | Directive | undefined;
|
|
9
|
+
export declare const extractType: (property: Property, defaultValue: any) => SBType;
|
|
10
|
+
export declare const extractArgTypesFromData: (componentData: Class | Directive | Injectable | Pipe) => ArgTypes<import("@storybook/types").Args>;
|
|
11
|
+
export declare const extractArgTypes: (component: Component | Directive) => ArgTypes<import("@storybook/types").Args> | null | undefined;
|
|
12
|
+
export declare const extractComponentDescription: (component: Component | Directive) => string | null | undefined;
|