Skip to content

Commit 478b1a9

Browse files
committed
docs: generate API documentation
- Generates the API documentation. `README.md` links to the generated API documentation.
1 parent b0ee29b commit 478b1a9

14 files changed

+263
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ So I decided to **develop a library that can aggregate symbols overlapping with
5353

5454
Please refer to my [blog post](https://codemonger.io/blog/0009-mapbox-collision-boxes/) for more details.
5555

56+
## API Documentation
57+
58+
Please refer to [`api-docs/markdown/index.md`](./api-docs/markdown/index.md).
59+
5660
## Tips
5761

5862
### Viewport padding

api-docs/mapbox-collision-boxes.api.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,4 @@ export interface FeatureBox {
2828
feature: QueryFeature;
2929
}
3030

31-
// (No @packageDocumentation comment for this package)
32-
3331
```

api-docs/markdown/index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md)
4+
5+
## API Reference
6+
7+
## Packages
8+
9+
| Package | Description |
10+
| --- | --- |
11+
| [mapbox-collision-boxes](./mapbox-collision-boxes.md) | Collision box utility for [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js/guides/)<!-- -->. |
12+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [mapbox-collision-boxes](./mapbox-collision-boxes.md) &gt; [Box](./mapbox-collision-boxes.box.md) &gt; [brX](./mapbox-collision-boxes.box.brx.md)
4+
5+
## Box.brX property
6+
7+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8+
>
9+
10+
X-coordinate value of the bottom-right corner of the box.
11+
12+
<b>Signature:</b>
13+
14+
```typescript
15+
brX: number;
16+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [mapbox-collision-boxes](./mapbox-collision-boxes.md) &gt; [Box](./mapbox-collision-boxes.box.md) &gt; [brY](./mapbox-collision-boxes.box.bry.md)
4+
5+
## Box.brY property
6+
7+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8+
>
9+
10+
Y-coordinate value of the bottom-right corner of the box.
11+
12+
<b>Signature:</b>
13+
14+
```typescript
15+
brY: number;
16+
```
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [mapbox-collision-boxes](./mapbox-collision-boxes.md) &gt; [Box](./mapbox-collision-boxes.box.md)
4+
5+
## Box interface
6+
7+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8+
>
9+
10+
Box in the screen coordinate.
11+
12+
<b>Signature:</b>
13+
14+
```typescript
15+
export interface Box
16+
```
17+
18+
## Properties
19+
20+
| Property | Modifiers | Type | Description |
21+
| --- | --- | --- | --- |
22+
| [brX](./mapbox-collision-boxes.box.brx.md) | | number | <b><i>(BETA)</i></b> X-coordinate value of the bottom-right corner of the box. |
23+
| [brY](./mapbox-collision-boxes.box.bry.md) | | number | <b><i>(BETA)</i></b> Y-coordinate value of the bottom-right corner of the box. |
24+
| [tlX](./mapbox-collision-boxes.box.tlx.md) | | number | <b><i>(BETA)</i></b> X-coordinate value of the top-left corner of the box. |
25+
| [tlY](./mapbox-collision-boxes.box.tly.md) | | number | <b><i>(BETA)</i></b> Y-coordinate value of the top-left corner of the box. |
26+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [mapbox-collision-boxes](./mapbox-collision-boxes.md) &gt; [Box](./mapbox-collision-boxes.box.md) &gt; [tlX](./mapbox-collision-boxes.box.tlx.md)
4+
5+
## Box.tlX property
6+
7+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8+
>
9+
10+
X-coordinate value of the top-left corner of the box.
11+
12+
<b>Signature:</b>
13+
14+
```typescript
15+
tlX: number;
16+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [mapbox-collision-boxes](./mapbox-collision-boxes.md) &gt; [Box](./mapbox-collision-boxes.box.md) &gt; [tlY](./mapbox-collision-boxes.box.tly.md)
4+
5+
## Box.tlY property
6+
7+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8+
>
9+
10+
Y-coordinate value of the top-left corner of the box.
11+
12+
<b>Signature:</b>
13+
14+
```typescript
15+
tlY: number;
16+
```
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [mapbox-collision-boxes](./mapbox-collision-boxes.md) &gt; [boxesIntersect](./mapbox-collision-boxes.boxesintersect.md)
4+
5+
## boxesIntersect() function
6+
7+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8+
>
9+
10+
Returns if two `Box`<!-- -->es intersect.
11+
12+
<b>Signature:</b>
13+
14+
```typescript
15+
export declare function boxesIntersect(box1: Box, box2: Box): boolean;
16+
```
17+
18+
## Parameters
19+
20+
| Parameter | Type | Description |
21+
| --- | --- | --- |
22+
| box1 | [Box](./mapbox-collision-boxes.box.md) | Box to be tested. |
23+
| box2 | [Box](./mapbox-collision-boxes.box.md) | Another box to be tested. |
24+
25+
<b>Returns:</b>
26+
27+
boolean
28+
29+
Whether `box1` and `box2` intersect.
30+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [mapbox-collision-boxes](./mapbox-collision-boxes.md) &gt; [collectCollisionBoxesAndFeatures](./mapbox-collision-boxes.collectcollisionboxesandfeatures.md)
4+
5+
## collectCollisionBoxesAndFeatures() function
6+
7+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8+
>
9+
10+
Collects collision boxes on a given Mapbox map layer.
11+
12+
<b>Signature:</b>
13+
14+
```typescript
15+
export declare function collectCollisionBoxesAndFeatures(map: Map, layerId: string): Promise<FeatureBox[]>;
16+
```
17+
18+
## Parameters
19+
20+
| Parameter | Type | Description |
21+
| --- | --- | --- |
22+
| map | Map | [Mapbox map](https://docs.mapbox.com/mapbox-gl-js/api/map/) instance. |
23+
| layerId | string | ID of the layer where collision boxes are to be collected. |
24+
25+
<b>Returns:</b>
26+
27+
Promise&lt;[FeatureBox](./mapbox-collision-boxes.featurebox.md)<!-- -->\[\]&gt;
28+
29+
Collision boxes and features on the layer associated with `layerId` on `map`<!-- -->.
30+
31+
## Exceptions
32+
33+
RangeError
34+
35+
If there is no layer associated with `layerId`<!-- -->, or if the layer associated with `layerId` is not a symbol layer.
36+
37+
Error
38+
39+
If there is an error.
40+
41+
## Remarks
42+
43+
This function waits until the last symbol placement finishes. The wait times out after five seconds.
44+

0 commit comments

Comments
 (0)