0.0.35 • Published 2 years ago
@escolalms/ts-models v0.0.35
Escola LMS (Wellms) TypeScript Definitions
Automatic transformation of Eloquent Models and Request rules to TypeScript Definition
This package transforms all Eloquent Models defined in
- main composer.json
- config typescript.php
to Typescript definitions
- pure definitions
- generated typedoc
Installing
- install dependencies
npm i @escolalms/ts-models
oryarn add @escolalms/ts-models
- import in main
index.d.ts
(if you have one)
import "@escolalms/ts-models";
- add this to
tsconfig
in include section
"include": ["node_modules/@escolalms/ts-models"]
The above is declaring namespaces, example ns EscolaLms.StationaryEvents.Models.StationaryEvent
that are take from PHP namespace.
Below is example
export async function stationaryEvents(
params: API.PaginationParams & {
name?: string;
},
options?: Record<string, any>
) {
return request<
API.DefaultMetaResponse<EscolaLms.StationaryEvents.Models.StationaryEvent>
>(`/api/admin/stationary-events`, {
method: "GET",
params: {
...params,
},
...(options || {}),
});
}
Adding new packages
- Add new package to composer.json
- Set proper namespace and package path in the config typescript.php
Releasing new version to npm
- Run generate action on main branch by pressing
re-run all jobs
- Wait until it's finished, new models.d.ts should be pushed automatically to the repository
- Once new models.d.ts You create new release rest should be handled by the script
- Release version on GH is the same as on npm (done automatically)
0.0.30
2 years ago
0.0.31
2 years ago
0.0.32
2 years ago
0.0.33
2 years ago
0.0.34
2 years ago
0.0.35
2 years ago
0.0.29
2 years ago
0.0.28
3 years ago
0.0.21
3 years ago
0.0.22
3 years ago
0.0.23
3 years ago
0.0.24
3 years ago
0.0.25
3 years ago
0.0.26
3 years ago
0.0.27
3 years ago
0.0.20
3 years ago
0.0.19
3 years ago
0.0.18
3 years ago
0.0.17
3 years ago
0.0.16
3 years ago
0.0.15
3 years ago
0.0.14
3 years ago
0.0.13
3 years ago
0.0.12
3 years ago
0.0.11
3 years ago
0.0.10
3 years ago
0.0.9
3 years ago
0.0.8
3 years ago
0.0.7
3 years ago
0.0.6
3 years ago
0.0.5
3 years ago
0.0.2
3 years ago