Skip to content

Commit

Permalink
minor enhacement for api-reference(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
tada5hi committed Aug 7, 2022
1 parent 88a809a commit 7ffbd8f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
20 changes: 13 additions & 7 deletions docs/guide/build-api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The allowed input keys are values of the [Parameter](parameter-api-reference.md#

**Type**
```ts
function buildQuery<T>(record: BuildInput<T>, options?: BuildOptions): string;
declare function buildQuery<T>(record: BuildInput<T>, options?: BuildOptions): string;
```

**Example**
Expand Down Expand Up @@ -56,13 +56,10 @@ The function returns a string, which can be parsed with the [parseQuery](parse-a

I.e. `/users?page[limit]=10&page[offset]=0&include=profile&filter[id]=1&fields[user]=id,name`

## `BuildOptions`
**References**
- [BuildInput](#buildinput)
- [BuildOptions](#buildoptions)

```typescript
export type BuildOptions = {
// empty type for now :)
}
```
## `BuildInput`

```typescript
Expand All @@ -72,3 +69,12 @@ export type BuildInput<
[T in Parameter | URLParameter]?: BuildParameterInput<T, V>
}
```
## `BuildOptions`
```typescript
export type BuildOptions = {
// empty type for now :)
}
```
8 changes: 6 additions & 2 deletions docs/guide/parse-api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ parsed data as value.

**Type**
```ts
function parseQuery(input: ParseInput, options?: ParseOptions): string;
declare function parseQuery(input: ParseInput, options?: ParseOptions): string;
```

**Example**
Expand Down Expand Up @@ -55,6 +55,10 @@ console.log(output);

The function returns an object.

**References**
- [ParseOutput](#parseoutput)
- [ParseOptions](#parseoptions)

## `parseQueryParameter`

Parse a query string to an efficient data structure ⚡. The output will
Expand All @@ -63,7 +67,7 @@ parsed data as value.

**Type**
```ts
function parseQueryParameter(
declare function parseQueryParameter(
key: T,
input: unknown,
options?: ParseParameterOptions<T>
Expand Down

0 comments on commit 7ffbd8f

Please sign in to comment.