Skip to content

Commit 9115be8

Browse files
committed
feat: export TypeScript typings
1 parent e06f6e8 commit 9115be8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+159
-67
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ node_modules
2424
lib/
2525
stats.json
2626
cypress/
27-
bundles
27+
bundles/
28+
typings/
2829
cli/index.js
2930

3031
/benchmark/revisions

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*
22
!bundles/*
3+
!typings/*
34
!package.json
45
!README.md
56
!LICENSE

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"React.js"
2424
],
2525
"main": "bundles/redoc.lib.js",
26+
"types": "typings/index.d.ts",
2627
"scripts": {
2728
"start": "webpack-dev-server --mode=development --env.playground --hot --config demo/webpack.config.ts",
2829
"start:prod": "webpack-dev-server --env.playground --mode=production --config demo/webpack.config.ts",
@@ -37,6 +38,7 @@
3738
"bundle:standalone": "webpack --env.standalone --mode=production",
3839
"bundle:lib": "webpack --mode=production",
3940
"bundle": "npm run bundle:clean && npm run bundle:lib && npm run bundle:standalone",
41+
"declarations": "rimraf typings && tsc --emitDeclarationOnly -p tsconfig.lib.json",
4042
"stats": "webpack --env.standalone --json --profile --mode=production > stats.json",
4143
"prettier": "prettier --write \"src/**/*.{ts,tsx}\"",
4244
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1",

src/common-elements/dropdown.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
import * as React from 'react';
12
import Dropdown from 'react-dropdown';
23

3-
import styled, { StyledComponentClass, withProps } from '../styled-components';
4+
import styled, {
5+
ResolvedThemeInterface,
6+
StyledComponentClass,
7+
withProps,
8+
} from '../styled-components';
49

510
export interface DropdownOption {
611
label: string;

src/common-elements/fields-layout.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import { transparentize } from 'polished';
2-
import styled, { withProps } from '../styled-components';
2+
import * as React from 'react';
3+
4+
import styled, {
5+
ResolvedThemeInterface,
6+
StyledComponentClass,
7+
withProps,
8+
} from '../styled-components';
39
import { deprecatedCss } from './mixins';
410

511
export const PropertiesTableCaption = styled.caption`

src/common-elements/fields.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { transparentize } from 'polished';
2-
import styled from '../styled-components';
2+
import * as React from 'react';
3+
4+
import styled, { ResolvedThemeInterface, StyledComponentClass } from '../styled-components';
35
import { PropertyNameCell } from './fields-layout';
46

57
export const ClickablePropertyNameCell = PropertyNameCell.extend`

src/common-elements/headers.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import styled, { css } from '../styled-components';
1+
import * as React from 'react';
2+
import { InterpolationFunction, Styles, ThemeProps } from 'styled-components';
3+
4+
import styled, { css, ResolvedThemeInterface, StyledComponentClass } from '../styled-components';
25

36
const headerFontSize = {
47
1: '1.85714em',

src/common-elements/linkify.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import styled, { css } from '../styled-components';
1+
import * as React from 'react';
2+
import { InterpolationFunction, Styles, ThemeProps } from 'styled-components';
3+
4+
import styled, { css, ResolvedThemeInterface, StyledComponentClass } from '../styled-components';
25

36
// tslint:disable-next-line
47
export const linkifyMixin = className => css`

src/common-elements/mixins.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { css } from '../styled-components';
1+
import { InterpolationFunction, Styles, ThemeProps } from 'styled-components';
2+
3+
import { css, StyledComponentClass } from '../styled-components';
24

35
export const deprecatedCss = css`
46
text-decoration: line-through;

src/common-elements/panels.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import styled, { media } from '../styled-components';
1+
import * as React from 'react';
2+
import styled, { media, ResolvedThemeInterface, StyledComponentClass } from '../styled-components';
23

34
export const MiddlePanel = styled.div`
45
width: calc(100% - ${props => props.theme.rightPanel.width});

0 commit comments

Comments
 (0)