Skip to content

Commit e134f90

Browse files
authored
generate api docs (#6)
1 parent 932ef85 commit e134f90

File tree

88 files changed

+1762
-2
lines changed

Some content is hidden

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

88 files changed

+1762
-2
lines changed

docs/.vitepress/config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default defineConfig({
3535
docFooter: { prev: "Previous page", next: "Next page" },
3636
nav: [
3737
{ text: "Guide", link: "/guide/", activeMatch: "/guide/" },
38+
{ text: "Reference", link: "/api/", activeMatch: "/api/" },
3839
{
3940
text: `v${(await import("./../../package.json")).version}`, items: [
4041
{ text: "Changes", link: "https://github.com/elringus/imgit/releases/latest" },

docs/api/imgit.assetspec.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [AssetSpec](./imgit.assetspec.md)
4+
5+
## AssetSpec type
6+
7+
Per-asset specifications assigned by the user.
8+
9+
**Signature:**
10+
11+
```typescript
12+
export type AssetSpec = {
13+
width?: number;
14+
eager?: boolean;
15+
merge?: boolean;
16+
media?: string;
17+
class?: string;
18+
};
19+
```

docs/api/imgit.assetsyntax.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [AssetSyntax](./imgit.assetsyntax.md)
4+
5+
## AssetSyntax type
6+
7+
Asset syntax captured from transformed document.
8+
9+
**Signature:**
10+
11+
```typescript
12+
export type AssetSyntax = {
13+
text: string;
14+
index: number;
15+
url: string;
16+
alt?: string;
17+
spec?: string;
18+
};
19+
```

docs/api/imgit.boot.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [boot](./imgit.boot.md)
4+
5+
## boot() function
6+
7+
Initializes build context with specified options.
8+
9+
**Signature:**
10+
11+
```typescript
12+
export declare function boot(prefs?: Prefs, platform?: Platform): Promise<void>;
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| prefs | [Prefs](./imgit.prefs.md) | _(Optional)_ Build preferences; will use pre-defined defaults when not assigned. |
20+
| platform | [Platform](./imgit.platform.md) | _(Optional)_ Runtime APIs to use; will attempt to detect automatically when not assigned. |
21+
22+
**Returns:**
23+
24+
Promise&lt;void&gt;
25+

docs/api/imgit.build.build.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build](./imgit.build.md) &gt; [build](./imgit.build.build.md)
4+
5+
## build.build() function
6+
7+
Default HTML builder for supported asset types (images and video).
8+
9+
**Signature:**
10+
11+
```typescript
12+
export declare function build(asset: BuiltAsset, merges?: BuiltAsset[]): Promise<void>;
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| asset | [BuiltAsset](./imgit.builtasset.md) | |
20+
| merges | [BuiltAsset](./imgit.builtasset.md)<!-- -->\[\] | _(Optional)_ |
21+
22+
**Returns:**
23+
24+
Promise&lt;void&gt;
25+

docs/api/imgit.build.buildall.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build](./imgit.build.md) &gt; [buildAll](./imgit.build.buildall.md)
4+
5+
## build.buildAll() function
6+
7+
Builds HTML for the optimized assets to overwrite source syntax.
8+
9+
**Signature:**
10+
11+
```typescript
12+
export declare function buildAll(assets: EncodedAsset[]): Promise<BuiltAsset[]>;
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| assets | [EncodedAsset](./imgit.encodedasset.md)<!-- -->\[\] | |
20+
21+
**Returns:**
22+
23+
Promise&lt;[BuiltAsset](./imgit.builtasset.md)<!-- -->\[\]&gt;
24+
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build](./imgit.build.md) &gt; [buildContentSource](./imgit.build.buildcontentsource.md)
4+
5+
## build.buildContentSource() function
6+
7+
Builds serve url for content file with specified full path based on configured root option.
8+
9+
**Signature:**
10+
11+
```typescript
12+
export declare function buildContentSource(path: string): string;
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| path | string | |
20+
21+
**Returns:**
22+
23+
string
24+
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build](./imgit.build.md) &gt; [CONTAINER\_ATTR](./imgit.build.container_attr.md)
4+
5+
## build.CONTAINER\_ATTR variable
6+
7+
Attribute expected on containers of HTML generated for imgit content.
8+
9+
**Signature:**
10+
11+
```typescript
12+
CONTAINER_ATTR = "data-imgit-container"
13+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build](./imgit.build.md) &gt; [COVER\_CONTAINED\_STYLE](./imgit.build.cover_contained_style.md)
4+
5+
## build.COVER\_CONTAINED\_STYLE variable
6+
7+
CSS style applied to contained elements, siblings to cover element.
8+
9+
**Signature:**
10+
11+
```typescript
12+
COVER_CONTAINED_STYLE = "width:100%;"
13+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build](./imgit.build.md) &gt; [COVER\_CONTAINER\_STYLE](./imgit.build.cover_container_style.md)
4+
5+
## build.COVER\_CONTAINER\_STYLE variable
6+
7+
CSS style applied to container of cover element.
8+
9+
**Signature:**
10+
11+
```typescript
12+
COVER_CONTAINER_STYLE = "display:flex;"
13+
```

docs/api/imgit.build.cover_style.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build](./imgit.build.md) &gt; [COVER\_STYLE](./imgit.build.cover_style.md)
4+
5+
## build.COVER\_STYLE variable
6+
7+
CSS style applied to cover element itself.
8+
9+
**Signature:**
10+
11+
```typescript
12+
COVER_STYLE = "width:100%;margin-left:-100%;"
13+
```

docs/api/imgit.build.loadable_attr.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build](./imgit.build.md) &gt; [LOADABLE\_ATTR](./imgit.build.loadable_attr.md)
4+
5+
## build.LOADABLE\_ATTR variable
6+
7+
Attribute expected on HTML elements loaded by imgit.
8+
9+
**Signature:**
10+
11+
```typescript
12+
LOADABLE_ATTR = "data-imgit-loadable"
13+
```

docs/api/imgit.build.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build](./imgit.build.md)
4+
5+
## build namespace
6+
7+
## Functions
8+
9+
| Function | Description |
10+
| --- | --- |
11+
| [build(asset, merges)](./imgit.build.build.md) | Default HTML builder for supported asset types (images and video). |
12+
| [buildAll(assets)](./imgit.build.buildall.md) | Builds HTML for the optimized assets to overwrite source syntax. |
13+
| [buildContentSource(path)](./imgit.build.buildcontentsource.md) | Builds serve url for content file with specified full path based on configured root option. |
14+
15+
## Variables
16+
17+
| Variable | Description |
18+
| --- | --- |
19+
| [CONTAINER\_ATTR](./imgit.build.container_attr.md) | Attribute expected on containers of HTML generated for imgit content. |
20+
| [COVER\_CONTAINED\_STYLE](./imgit.build.cover_contained_style.md) | CSS style applied to contained elements, siblings to cover element. |
21+
| [COVER\_CONTAINER\_STYLE](./imgit.build.cover_container_style.md) | CSS style applied to container of cover element. |
22+
| [COVER\_STYLE](./imgit.build.cover_style.md) | CSS style applied to cover element itself. |
23+
| [LOADABLE\_ATTR](./imgit.build.loadable_attr.md) | Attribute expected on HTML elements loaded by imgit. |
24+

docs/api/imgit.build_2.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build\_2](./imgit.build_2.md)
4+
5+
## build\_2() function
6+
7+
Default HTML builder for supported asset types (images and video).
8+
9+
**Signature:**
10+
11+
```typescript
12+
export declare function build(asset: BuiltAsset, merges?: BuiltAsset[]): Promise<void>;
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| asset | [BuiltAsset](./imgit.builtasset.md) | |
20+
| merges | [BuiltAsset](./imgit.builtasset.md)<!-- -->\[\] | _(Optional)_ |
21+
22+
**Returns:**
23+
24+
Promise&lt;void&gt;
25+

docs/api/imgit.buildall.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [buildAll](./imgit.buildall.md)
4+
5+
## buildAll() function
6+
7+
Builds HTML for the optimized assets to overwrite source syntax.
8+
9+
**Signature:**
10+
11+
```typescript
12+
export declare function buildAll(assets: EncodedAsset[]): Promise<BuiltAsset[]>;
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| assets | [EncodedAsset](./imgit.encodedasset.md)<!-- -->\[\] | |
20+
21+
**Returns:**
22+
23+
Promise&lt;[BuiltAsset](./imgit.builtasset.md)<!-- -->\[\]&gt;
24+

docs/api/imgit.buildcontentsource.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [buildContentSource](./imgit.buildcontentsource.md)
4+
5+
## buildContentSource() function
6+
7+
Builds serve url for content file with specified full path based on configured root option.
8+
9+
**Signature:**
10+
11+
```typescript
12+
export declare function buildContentSource(path: string): string;
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| path | string | |
20+
21+
**Returns:**
22+
23+
string
24+

docs/api/imgit.builtasset.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [BuiltAsset](./imgit.builtasset.md)
4+
5+
## BuiltAsset type
6+
7+
Final product of asset transformation with associated HTML.
8+
9+
**Signature:**
10+
11+
```typescript
12+
export type BuiltAsset = EncodedAsset & {
13+
html: string;
14+
};
15+
```
16+
**References:** [EncodedAsset](./imgit.encodedasset.md)
17+

docs/api/imgit.cache.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [cache](./imgit.cache.md)
4+
5+
## cache variable
6+
7+
Cached results of the build operations.
8+
9+
**Signature:**
10+
11+
```typescript
12+
cache: Cache
13+
```

docs/api/imgit.cache_2.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [Cache\_2](./imgit.cache_2.md)
4+
5+
## Cache\_2 type
6+
7+
Cached results of the build operations. Each property is persisted as a standalone JSON file between build runs. Custom properties can be added.
8+
9+
**Signature:**
10+
11+
```typescript
12+
export type Cache = Record<string, unknown> & {
13+
sizes: Record<string, number>;
14+
probes: Record<string, ContentInfo>;
15+
specs: Record<string, EncodeSpec>;
16+
covers: Record<string, string>;
17+
};
18+
```
19+
**References:** [ContentInfo](./imgit.contentinfo.md)<!-- -->, [EncodeSpec](./imgit.encodespec.md)
20+

docs/api/imgit.cacheoptions.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [CacheOptions](./imgit.cacheoptions.md)
4+
5+
## CacheOptions type
6+
7+
Configures server cache.
8+
9+
**Signature:**
10+
11+
```typescript
12+
export type CacheOptions = {
13+
root: string;
14+
};
15+
```

0 commit comments

Comments
 (0)