0.0.35 • Published 1 year ago

@escolalms/ts-models v0.0.35

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Escola LMS (Wellms) TypeScript Definitions

npm | typedoc page

Automatic transformation of Eloquent Models and Request rules to TypeScript Definition

This package transforms all Eloquent Models defined in

to Typescript definitions

Installing

  1. install dependencies npm i @escolalms/ts-models or yarn add @escolalms/ts-models
  2. import in main index.d.ts (if you have one)
import "@escolalms/ts-models";
  1. 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

  1. Add new package to composer.json
  2. Set proper namespace and package path in the config typescript.php

Releasing new version to npm

  1. Run generate action on main branch by pressing re-run all jobs
  2. Wait until it's finished, new models.d.ts should be pushed automatically to the repository
  3. Once new models.d.ts You create new release rest should be handled by the script
  4. Release version on GH is the same as on npm (done automatically)
0.0.30

1 year ago

0.0.31

1 year ago

0.0.32

1 year ago

0.0.33

1 year ago

0.0.34

1 year ago

0.0.35

1 year ago

0.0.29

1 year ago

0.0.28

2 years ago

0.0.21

2 years ago

0.0.22

2 years ago

0.0.23

2 years ago

0.0.24

2 years ago

0.0.25

2 years ago

0.0.26

2 years ago

0.0.27

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.2

2 years ago