Skip to content
This repository was archived by the owner on Feb 15, 2025. It is now read-only.

Commit 378badb

Browse files
authored
Merge pull request #17 from agile-ts/develop
Develop
2 parents eda6561 + 84e42b1 commit 378badb

28 files changed

+1525
-91
lines changed

docs/Interfaces.md

Lines changed: 144 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ slug: /interfaces
77

88
:::info
99

10-
Here are all documented Interfaces of AgileTs listed!
10+
Here all Interfaces required for working with AgileTs are listed!
1111

1212
:::
1313

1414

15-
### `CreateLoggerConfig`
15+
## `CreateLoggerConfig`
1616

1717
```ts
1818
export interface CreateLoggerConfigInterface {
@@ -41,7 +41,7 @@ export interface CreateLoggerConfigInterface {
4141
<br/>
4242

4343

44-
### `StorageMethods`
44+
## `StorageMethods`
4545

4646
```ts
4747
export interface StorageMethodsInterface {
@@ -65,7 +65,7 @@ export interface StorageMethodsInterface {
6565
<br/>
6666

6767

68-
### `StateConfig`
68+
## `StateConfig`
6969

7070
```ts
7171
export interface StateConfigInterface {
@@ -89,7 +89,7 @@ export interface StateConfigInterface {
8989
<br/>
9090

9191

92-
### `CollectionConfig`
92+
## `CollectionConfig`
9393

9494
```ts
9595
export type CollectionConfig<DataType = DefaultItem> =
@@ -98,7 +98,7 @@ export type CollectionConfig<DataType = DefaultItem> =
9898
collection: Collection<DataType>
9999
) => CreateCollectionConfigInterface<DataType>);
100100
```
101-
*[CreateCollectionConfigInterface](#createcollectionconfig)
101+
* [CreateCollectionConfigInterface](#createcollectionconfig)
102102

103103
**There are two ways configuring the Collection:**
104104

@@ -130,7 +130,7 @@ collection: Collection<DataType>
130130
<br/>
131131

132132

133-
### `CreateCollectionConfig`
133+
## `CreateCollectionConfig`
134134

135135
```ts
136136
export interface CreateCollectionConfigInterface<DataType = DefaultItem> {
@@ -141,7 +141,6 @@ export interface CreateCollectionConfigInterface<DataType = DefaultItem> {
141141
defaultGroupKey?: GroupKey;
142142
initialData?: Array<DataType>;
143143
}
144-
145144
```
146145
| Prop | Type | Default | Description | Required |
147146
|-------------------|-------------------------------------------------|-----------|--------------------------------------------------------------------------------------------------------|----------|
@@ -160,7 +159,7 @@ export interface CreateCollectionConfigInterface<DataType = DefaultItem> {
160159
<br/>
161160

162161

163-
### `CreateEventConfig`
162+
## `CreateEventConfig`
164163

165164
```ts
166165
export interface CreateEventConfigInterface {
@@ -182,4 +181,139 @@ export interface CreateEventConfigInterface {
182181
| `delay` | number (in ms) | undefined | If the Event should have an trigger delay | No |
183182
| `overlap` | boolean | false | If a triggered Event can overlap another triggered Event from same Event Class | No |
184183
| `rerender` | boolean | false | If a Event trigger can rerender a Component (useEvent) | No |
185-
| `dependents` | Observer[] | [] | Initial dependents of the State -> if State mutates, the dependents will be ingested into the Runtime too | No |
184+
| `dependents` | Observer[] | [] | Initial dependents of the State -> if State mutates, the dependents will be ingested into the Runtime too | No |
185+
186+
187+
<br/>
188+
189+
---
190+
191+
<br/>
192+
193+
194+
## `StateIngestConfig`
195+
196+
```ts
197+
export interface StateIngestConfigInterface
198+
extends StateRuntimeJobConfigInterface,
199+
IngestConfigInterface {
200+
key?: RuntimeJobKey;
201+
}
202+
```
203+
* [RuntimeJobConfigInterface](#stateruntimejobconfig) <br/>
204+
* [IngestConfigInterface](#ingestconfig)
205+
206+
| Prop | Type | Default | Description | Required |
207+
|------|------------------|-------------|------------------------------------------------------------------------------------------------|----------|
208+
| key | string \| number | undefined | Key/Name of Job that gets created | No |
209+
210+
211+
<br/>
212+
213+
---
214+
215+
<br/>
216+
217+
218+
## `StateRuntimeJobConfig`
219+
220+
```ts
221+
export interface StateRuntimeJobConfigInterface
222+
extends RuntimeJobConfigInterface {
223+
overwrite?: boolean;
224+
storage?: boolean;
225+
}
226+
```
227+
* [RuntimeJobConfigInterface](#runtimejobconfig)
228+
229+
| Prop | Type | Default | Description | Required |
230+
|-----------|---------|---------|------------------------------------------------------------------------------------------------|----------|
231+
| overwrite | boolean | false | If whole State gets overwritten with the new Value (initialStateValue, previousStateValue, ..) | No |
232+
| storage | boolean | true | If State changes get applied to the Storage (only if State got persisted (`persist`)) | No |
233+
234+
235+
<br/>
236+
237+
---
238+
239+
<br/>
240+
241+
242+
## `RuntimeJobConfig`
243+
244+
```ts
245+
export interface RuntimeJobConfigInterface {
246+
background?: boolean;
247+
sideEffects?: boolean;
248+
force?: boolean;
249+
}
250+
```
251+
252+
| Prop | Type | Default | Description | Required |
253+
|-------------|---------|---------|--------------------------------------------------------------------------------------|----------|
254+
| background | boolean | false | If the Job runs through the Runtime in the background -> does not trigger a rerender | No |
255+
| sideEffects | boolean | true | If sideEffects of the Job get executed | No |
256+
| force | boolean | false | If the Job gets chased through the Runtime, no matter what happens | No |
257+
258+
259+
<br/>
260+
261+
---
262+
263+
<br/>
264+
265+
266+
## `IngestConfig`
267+
268+
```ts
269+
export interface IngestConfigInterface {
270+
perform?: boolean;
271+
}
272+
```
273+
274+
| Prop | Type | Default | Description | Required |
275+
|----------|------------------|-------------|------------------------------------------------------------------------------------------------|----------|
276+
| perform | boolean | true | If Job gets performed immediately | No |
277+
278+
279+
<br/>
280+
281+
---
282+
283+
<br/>
284+
285+
286+
## `PatchConfig`
287+
288+
```ts
289+
export interface PatchConfigInterface extends StateIngestConfigInterface {
290+
addNewProperties?: boolean;
291+
}
292+
```
293+
* [StateIngestConfigInterface](#stateingestconfig)
294+
295+
| Prop | Type | Default | Description | Required |
296+
|-------------------|------------------|-------------|------------------------------------------------------------------------------------------------|----------|
297+
| addNewProperties | boolean | true | If new properties get added to the State Value | No |
298+
299+
300+
<br/>
301+
302+
---
303+
304+
<br/>
305+
306+
307+
## `StatePersistentConfig`
308+
309+
```ts
310+
export interface StatePersistentConfigInterface {
311+
instantiate?: boolean;
312+
storageKeys?: StorageKey[];
313+
}
314+
```
315+
316+
| Prop | Type | Default | Description | Required |
317+
|-------------------|--------------------------|-------------|-------------------------------------------------------------------------------------------------------------------------|----------|
318+
| instantiate | boolean | true | If Persistent gets instantiated | No |
319+
| storageKeys | Array<string \| number> | true | Key/Name of Storages which gets used to persist the State Value (NOTE: If not passed the default Storage will be used) | No |

docs/packages/api/Installation.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@ sidebar_label: Installation
55
slug: /api/installation
66
---
77

8+
The `api` package can be installed over [npm](https://www.npmjs.com/).
9+
10+
:::warning
11+
12+
Be aware that this is no standalone package!
13+
14+
:::
15+
816
```bash npm2yarn
917
npm install @agile-ts/api
10-
```
18+
```
19+
20+
The `api` package is an extension of AgileTs and doesn't work without the [`core` package](../core/Introduction.md),
21+
which functions as the brain of AgileTs and is indispensable.
22+
Unfortunately, we can't combine each `core` with `api` version.
23+
Therefore, we have created a table which shows which versions fit together without restrictions.
24+
25+
| @agile-ts/api | @agile-ts/core | NPM Version | Supported React versions |
26+
| ----------------------| ----------------------- | ------------------------ | -------------------------|
27+
| v0.0.7+ | v0.0.7+ | v6+ | 16.8+ |
28+
| v0.0.6 | v0.0.3 - v0.0.6 | v6+ | 16.8+ |
29+
_Other Versions aren't supported anymore_

docs/packages/api/Introduction.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,44 @@ slug: /api
99

1010
WIP Package!
1111

12-
:::
12+
:::
13+
14+
> Promise based HTTP request API
15+
16+
<br />
17+
18+
<a href="https://github.com/agile-ts/agile">
19+
<img src="https://img.shields.io/github/license/agile-ts/agile.svg?label=license&style=flat&colorA=293140&colorB=4a4872" alt="GitHub License"/></a>
20+
<a href="https://npm.im/@agile-ts/api">
21+
<img src="https://img.shields.io/npm/v/@agile-ts/api.svg?label=npm&style=flat&colorA=293140&colorB=4a4872" alt="npm version"/></a>
22+
<a href="https://npm.im/@agile-ts/api">
23+
<img src="https://img.shields.io/bundlephobia/min/@agile-ts/api.svg?label=minified%20size&style=flat&colorA=293140&colorB=4a4872" alt="npm minified size"/></a>
24+
<a href="https://npm.im/@agile-ts/api">
25+
<img src="https://img.shields.io/npm/dt/@agile-ts/api.svg?label=downloads&style=flat&colorA=293140&colorB=4a4872" alt="npm total downloads"/></a>
26+
27+
## `api`
28+
29+
The `api` package is a Promise based HTTP/s request API, with a simple syntax.
30+
31+
### ⏰ Short Example
32+
```ts
33+
// Let't create our API
34+
const api = new API({
35+
baseURL: 'https://myapp.com', // Base Route to the Host
36+
timeout: 10000, // After which amount of time a request times out
37+
options: { credentials: 'include' } // Http/s Request Options from type RequestInit
38+
});
39+
40+
// Now we can create our first Request to 'https://myapp.com/hello'
41+
const response = await api.get('/hello');
42+
console.log(response);
43+
/*
44+
{
45+
data: {hello: "Jeff"}; // Response Data
46+
timedout: false; // If Request has timedout
47+
status: 200; // Response Status Code
48+
raw: Response; // Raw Response from type Response
49+
type: "application/json"; // Response Type
50+
}
51+
*/
52+
```

docs/packages/core/Introduction.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ slug: /core
77

88
> **Brain of AgileTs**
99
10-
<br />
10+
<br />
1111

12-
<a href="https://github.com/agile-ts/agile">
12+
<a href="https://github.com/agile-ts/agile">
1313
<img src="https://img.shields.io/github/license/agile-ts/agile.svg?label=license&style=flat&colorA=293140&colorB=4a4872" alt="GitHub License"/></a>
14-
<a href="https://npm.im/@agile-ts/react">
14+
<a href="https://npm.im/@agile-ts/core">
1515
<img src="https://img.shields.io/npm/v/@agile-ts/core.svg?label=npm&style=flat&colorA=293140&colorB=4a4872" alt="npm version"/></a>
16-
<a href="https://npm.im/@agile-ts/react">
16+
<a href="https://npm.im/@agile-ts/core">
1717
<img src="https://img.shields.io/bundlephobia/min/@agile-ts/core.svg?label=minified%20size&style=flat&colorA=293140&colorB=4a4872" alt="npm minified size"/></a>
18-
<a href="https://npm.im/@agile-ts/react">
18+
<a href="https://npm.im/@agile-ts/core">
1919
<img src="https://img.shields.io/npm/dt/@agile-ts/core.svg?label=downloads&style=flat&colorA=293140&colorB=4a4872" alt="npm total downloads"/></a>
2020

2121

docs/packages/core/features/agile-instance/Introduction.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ sidebar_label: Introduction
55
slug: /core/agile-instance
66
---
77

8+
:::warning
9+
10+
WIP docs!
11+
12+
:::
13+
814
The _Agile Instance_ is created with `new Agile()`and should be unique to our application.
915
```ts
1016
const App = new Agile();
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
id: properties
3+
title: Properties
4+
sidebar_label: Properties
5+
slug: /core/agile-instance/properties
6+
---
7+
8+
:::info
9+
10+
Here useful properties of the `Agile Instance` are described.
11+
12+
:::
13+
14+
## `logger`
15+
16+
The logger gets used to Log warnings, errors, .. in AgileTs, but of course we can
17+
use it in our Application too.
18+
```ts
19+
Agile.logger.warn("This is a Warning");
20+
Agile.logger.log("This is a normal Log");
21+
Agile.logger.if.tag(["render"]).warn("Logs this Warning if the Logger has the Tag 'rerender' active");
22+
```
23+

0 commit comments

Comments
 (0)