Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stonecrop] fix stonecrop documentation generation #230

Merged
merged 2 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@stonecrop/stonecrop",
"comment": "fix stonecrop documentation generation",
"type": "patch"
}
],
"packageName": "@stonecrop/stonecrop"
}
156 changes: 140 additions & 16 deletions common/reviews/api/stonecrop.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,154 @@

```ts

import DoctypeMeta from '@/doctype';
import { ImmutableDoctype } from '@/types';
import { InstallOptions } from '@/types';
import { MutableDoctype } from '@/types';
import Registry from '@/registry';
import { Schema } from '@/types';
import Stonecrop from '@/plugins';
import { useStonecrop } from '@/composable';
import { Component } from 'vue';
import { List } from 'immutable';
import { MachineConfig } from 'xstate';
import { Map as Map_2 } from 'immutable';
import { Plugin as Plugin_2 } from 'vue';
import { Ref } from 'vue';
import { Router } from 'vue-router';
import { StateMachine } from 'xstate';
import { StoreDefinition } from 'pinia';

export { DoctypeMeta }
// @public
export type BaseSchema = {
fieldname: string;
component?: string;
value?: any;
};

export { ImmutableDoctype }
// @public
export type CellContext = {
row: TableRow;
column: TableColumn;
table: {
[key: string]: any;
};
};

export { InstallOptions }
// @public
export class DoctypeMeta {
constructor(doctype: string, schema: ImmutableDoctype['schema'], workflow: ImmutableDoctype['workflow'], actions: ImmutableDoctype['actions'], component?: Component);
readonly actions: ImmutableDoctype['actions'];
readonly component?: Component;
readonly doctype: string;
readonly schema: ImmutableDoctype['schema'];
get slug(): string;
readonly workflow: ImmutableDoctype['workflow'];
}

export { MutableDoctype }
// @public
export type FieldsetSchema = BaseSchema & {
label?: string;
schema?: (FormSchema | TableSchema)[];
collapsible?: boolean;
};

export { Registry }
// @public
export type FormSchema = BaseSchema & {
align?: string;
edit?: boolean;
fieldtype?: string;
label?: string;
name?: string;
width?: string;
mask?: string;
};

export { Schema }
// @public
export type ImmutableDoctype = {
readonly schema?: List<SchemaTypes>;
readonly workflow: StateMachine<unknown, unknown, any>;
readonly actions?: Map_2<string, string[]>;
};

export { Stonecrop }
// @public
export type InstallOptions = {
router?: Router;
components?: Record<string, Component>;
getMeta?: (doctype?: string) => DoctypeMeta | Promise<DoctypeMeta>;
};

export { useStonecrop }
// @public
export type MutableDoctype = {
schema?: SchemaTypes[];
workflow: MachineConfig<unknown, unknown, any>;
actions?: Record<string, string[]>;
};

// @public
export class Registry {
constructor(router: Router, getMeta?: (doctype: string) => DoctypeMeta | Promise<DoctypeMeta>);
addDoctype(doctype: DoctypeMeta): void;
getMeta?: (doctype: string) => DoctypeMeta | Promise<DoctypeMeta>;
name: string;
registry: Record<string, DoctypeMeta>;
static _root: Registry;
router: Router;
}

// @public
export type Schema = {
doctype: string;
schema: List<SchemaTypes>;
};

// @public
export type SchemaTypes = FormSchema | TableSchema | FieldsetSchema;

// @public
export const Stonecrop: Plugin_2;

// @public
export type StonecropReturn = {
stonecrop: Ref<Stonecrop_2>;
isReady: Ref<boolean>;
};

// @public
export type TableColumn = {
name: string;
align?: CanvasTextAlign;
edit?: boolean;
label?: string;
type?: string;
width?: string;
pinned?: boolean;
cellComponent?: string;
cellComponentProps?: Record<string, any>;
modalComponent?: string | ((context: CellContext) => string);
modalComponentExtraProps?: Record<string, any>;
format?: string | ((value: any, context: CellContext) => string);
mask?: (value: any) => any;
};

// @public
export type TableConfig = {
view?: 'uncounted' | 'list' | 'list-expansion' | 'tree';
fullWidth?: boolean;
};

// @public
export type TableRow = {
[key: string]: any;
indent?: number;
parent?: number;
};

// @public
export type TableSchema = BaseSchema & {
columns?: TableColumn[];
config?: TableConfig;
rows?: TableRow[];
};

// @public
export function useStonecrop(registry?: Registry): StonecropReturn;

// Warnings were encountered during analysis:
//
// src/composable.ts:12:2 - (ae-forgotten-export) The symbol "Stonecrop_2" needs to be exported by the entry point index.d.ts

// (No @packageDocumentation comment for this package)

Expand Down
17 changes: 17 additions & 0 deletions docs/stonecrop/stonecrop.baseschema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@stonecrop/stonecrop](./stonecrop.md) &gt; [BaseSchema](./stonecrop.baseschema.md)

## BaseSchema type

Basic field structure for AForm schemas

**Signature:**

```typescript
export type BaseSchema = {
fieldname: string;
component?: string;
value?: any;
};
```
21 changes: 21 additions & 0 deletions docs/stonecrop/stonecrop.cellcontext.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@stonecrop/stonecrop](./stonecrop.md) &gt; [CellContext](./stonecrop.cellcontext.md)

## CellContext type

Table cell context definition.

**Signature:**

```typescript
export type CellContext = {
row: TableRow;
column: TableColumn;
table: {
[key: string]: any;
};
};
```
**References:** [TableRow](./stonecrop.tablerow.md)<!-- -->, [TableColumn](./stonecrop.tablecolumn.md)

105 changes: 105 additions & 0 deletions docs/stonecrop/stonecrop.doctypemeta._constructor_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@stonecrop/stonecrop](./stonecrop.md) &gt; [DoctypeMeta](./stonecrop.doctypemeta.md) &gt; [(constructor)](./stonecrop.doctypemeta._constructor_.md)

## DoctypeMeta.(constructor)

Constructs a new instance of the `DoctypeMeta` class

**Signature:**

```typescript
constructor(doctype: string, schema: ImmutableDoctype['schema'], workflow: ImmutableDoctype['workflow'], actions: ImmutableDoctype['actions'], component?: Component);
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

doctype


</td><td>

string


</td><td>


</td></tr>
<tr><td>

schema


</td><td>

[ImmutableDoctype](./stonecrop.immutabledoctype.md)<!-- -->\['schema'\]


</td><td>


</td></tr>
<tr><td>

workflow


</td><td>

[ImmutableDoctype](./stonecrop.immutabledoctype.md)<!-- -->\['workflow'\]


</td><td>


</td></tr>
<tr><td>

actions


</td><td>

[ImmutableDoctype](./stonecrop.immutabledoctype.md)<!-- -->\['actions'\]


</td><td>


</td></tr>
<tr><td>

component


</td><td>

Component


</td><td>

_(Optional)_


</td></tr>
</tbody></table>
13 changes: 13 additions & 0 deletions docs/stonecrop/stonecrop.doctypemeta.actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@stonecrop/stonecrop](./stonecrop.md) &gt; [DoctypeMeta](./stonecrop.doctypemeta.md) &gt; [actions](./stonecrop.doctypemeta.actions.md)

## DoctypeMeta.actions property

The doctype actions

**Signature:**

```typescript
readonly actions: ImmutableDoctype['actions'];
```
13 changes: 13 additions & 0 deletions docs/stonecrop/stonecrop.doctypemeta.component.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@stonecrop/stonecrop](./stonecrop.md) &gt; [DoctypeMeta](./stonecrop.doctypemeta.md) &gt; [component](./stonecrop.doctypemeta.component.md)

## DoctypeMeta.component property

The doctype component

**Signature:**

```typescript
readonly component?: Component;
```
13 changes: 13 additions & 0 deletions docs/stonecrop/stonecrop.doctypemeta.doctype.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@stonecrop/stonecrop](./stonecrop.md) &gt; [DoctypeMeta](./stonecrop.doctypemeta.md) &gt; [doctype](./stonecrop.doctypemeta.doctype.md)

## DoctypeMeta.doctype property

The doctype name

**Signature:**

```typescript
readonly doctype: string;
```
Loading
Loading