Skip to content

Commit 5af4aa2

Browse files
committed
chore: auto-gen type docs
1 parent fdb148b commit 5af4aa2

23 files changed

+2715
-320
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ test-report.xml
1414
yarn-error.log
1515
/build
1616
/docs/
17+
/generated/

packages/dockview-core/src/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ export * from './paneview/draggablePaneviewPanel';
2626

2727
export * from './dockview/components/panel/content';
2828
export * from './dockview/components/tab/tab';
29+
export {
30+
TabDragEvent,
31+
GroupDragEvent,
32+
} from './dockview/components/titlebar/tabsContainer';
2933
export * from './dockview/types';
3034
export * from './dockview/dockviewGroupPanel';
3135

packages/docs/docs/components/dockview.mdx

+30-79
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import DockviewWithIFrames from '@site/sandboxes/iframe-dockview/src/app';
2828
import DockviewFloating from '@site/sandboxes/floatinggroup-dockview/src/app';
2929
import DockviewLockedGroup from '@site/sandboxes/lockedgroup-dockview/src/app';
3030

31+
import { DocRef, Markdown } from '@site/src/components/ui/reference/docRef';
32+
3133
import { attach as attachDockviewVanilla } from '@site/sandboxes/javascript/vanilla-dockview/src/app';
3234
import { attach as attachSimpleDockview } from '@site/sandboxes/javascript/simple-dockview/src/app';
3335
import { attach as attachTabHeightDockview } from '@site/sandboxes/javascript/tabheight-dockview/src/app';
@@ -54,25 +56,12 @@ Dockview is an abstraction built on top of [Gridviews](./gridview) where each vi
5456

5557
You can create a Dockview through the use of the `DockviewReact` component.
5658

57-
```tsx
58-
import { DockviewReact } from 'dockview';
59-
```
60-
61-
| Property | Type | Optional | Default | Description |
62-
| --------------------------- | ------------------------------------ | -------- | --------- | ----------- |
63-
| onReady | (event: SplitviewReadyEvent) => void | No | | |
64-
| components | object | No | | |
65-
| tabComponents | object | Yes | | |
66-
| watermarkComponent | object | Yes | | |
67-
| hideBorders | boolean | Yes | false | |
68-
| className | string | Yes | '' | |
69-
| disableAutoResizing | boolean | Yes | false | |
70-
| onDidDrop | Event | Yes | false | |
71-
| showDndOverlay | Event | Yes | false | |
72-
| defaultTabComponent | object | Yes | | |
73-
| leftHeaderActionsComponent | object | Yes | | |
74-
| rightHeaderActionsComponent | object | Yes | | |
75-
| singleTabMode | 'fullwidth' \| 'default' | Yes | 'default' | |
59+
<p style={{ fontSize: '1.3em' }}>
60+
<span>{'All of these are React props available through the '}</span>
61+
<code>DockviewReact</code>
62+
<span>{' component.'}</span>
63+
</p>
64+
<DocRef declaration="IDockviewReactProps" />
7665

7766
## Dockview API
7867

@@ -93,44 +82,19 @@ const onReady = (event: DockviewReadyEvent) => {
9382
};
9483
```
9584

96-
| Property | Type | Description |
97-
| ---------------------- | ---------------------------------------------------- | ------------------------- |
98-
| height | `number` | Component pixel height |
99-
| width | `number` | Component pixel width |
100-
| minimumHeight | `number` | |
101-
| maximumHeight | `number` | |
102-
| maximumWidth | `number` | |
103-
| maximumWidth | `number` | |
104-
| length | `number` | Number of panels |
105-
| size | `number` | Number of Groups |
106-
| panels | `IDockviewPanel[]` | |
107-
| groups | `GroupPanel[]` | |
108-
| activePanel | `IDockviewPanel \| undefined` | |
109-
| activeGroup | `IDockviewPanel \| undefined` | |
110-
| | | |
111-
| onDidLayoutChange | `Event<void>` | |
112-
| onDidLayoutFromJSON | `Event<void>` | |
113-
| onDidAddGroup | `Event<GroupPanel>` | |
114-
| onDidRemoveGroup | `Event<GroupPanel>` | |
115-
| onDidActiveGroupChange | `Event<GroupPanel \| undefined>` | |
116-
| onDidAddPanel | `Event<IDockviewPanel>` | |
117-
| onDidRemovePanel | `Event<IDockviewPanel>` | |
118-
| onDidActivePanelChange | `Event<IDockviewPanel \| undefined>` | |
119-
| onDidDrop | `Event<DockviewDropEvent` | |
120-
| | | |
121-
| addPanel | `addPanel(options: AddPanelOptions): IDockviewPanel` | |
122-
| getPanel | `(id: string) \| IDockviewPanel \| undefined` | |
123-
| addGroup | `(options? AddGroupOptions): void` | |
124-
| closeAllGroups | `(): void` | |
125-
| removeGroup | `(group: GroupPanel): void` | |
126-
| getGroup | `(id: string): GroupPanel \| undefined` | |
127-
| | | |
128-
| updateOptions | `(options:SplitviewComponentUpdateOptions): void` | |
129-
| focus | `(): void` | |
130-
| layout | `(width: number, height:number): void` | |
131-
| fromJSON | `(data: SerializedDockview): void` | |
132-
| toJSON | `(): SerializedDockview` | |
133-
| clear | `(): void` | Clears the current layout |
85+
<p style={{ fontSize: '1.3em' }}>
86+
<span>{'All of these methods are available through the '}</span>
87+
<code>api</code>
88+
<span>{' property of '}</span>
89+
<code>DockviewComponent</code>
90+
<span>{' and the '}</span>
91+
<code>containerApi</code>
92+
<span>{' property of '}</span>
93+
<code>IDockviewPanel</code>
94+
<span>.</span>
95+
</p>
96+
97+
<DocRef declaration="DockviewApi" />
13498

13599
## Dockview Panel API
136100

@@ -142,28 +106,15 @@ const MyComponent = (props: IDockviewPanelProps<{ title: string }>) => {
142106
};
143107
```
144108

145-
| Property | Type | Description |
146-
| ---------------------- | ----------------------------------------------------------- | ---------------- |
147-
| id | `string` | Panel id |
148-
| isFocused | `boolean` | Is panel focused |
149-
| isActive | `boolean` | Is panel active |
150-
| width | `number` | Panel width |
151-
| height | `number` | Panel height |
152-
| onDidDimensionsChange | `Event<PanelDimensionChangeEvent>` | |
153-
| onDidFocusChange | `Event<FocusEvent>` | |
154-
| onDidVisibilityChange | `Event<VisibilityEvent>` | |
155-
| onDidActiveChange | `Event<ActiveEvent>` | |
156-
| setActive | `(): void` | |
157-
| | | |
158-
| onDidConstraintsChange | `onDidConstraintsChange: Event<PanelConstraintChangeEvent>` | |
159-
| setConstraints | `(value: PanelConstraintChangeEvent2): void;` | |
160-
| setSize | `(event: SizeEvent): void` | |
161-
| | | |
162-
| group | `GroupPanel | undefined` |
163-
| isGroupActive | `boolean` | |
164-
| title | `string` | |
165-
| close | `(): void` | |
166-
| setTitle | `(title: string): void` | |
109+
<p style={{ fontSize: '1.3em' }}>
110+
<span>{'All of these are methods are available through the '}</span>
111+
<code>api</code>
112+
<span>{' property of '}</span>
113+
<code>IDockviewPanel</code>
114+
<span>.</span>
115+
</p>
116+
117+
<DocRef declaration="DockviewPanelApi" />
167118

168119
## Theme
169120

0 commit comments

Comments
 (0)