mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-22 09:32:53 -06:00
TypeScript readme
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
`gflib.ts` is a TypeScript implementation of the GF runtime.
|
`gflib.ts` is a TypeScript implementation of the GF runtime.
|
||||||
It is ported from an older JavaScript implementation [`gflib.js`](../javascript/gflib.js),
|
It is ported from an older JavaScript implementation [`gflib.js`](../javascript/gflib.js),
|
||||||
with some small improvements.
|
with some improvements.
|
||||||
|
|
||||||
Importantly, all **future** updates will only be made to this TypeScript version.
|
Importantly, all **future** updates will only be made to this TypeScript version.
|
||||||
|
|
||||||
@@ -15,11 +15,16 @@ So its features are limited and it is not efficient, making it really only usefu
|
|||||||
## Using
|
## Using
|
||||||
|
|
||||||
`gflib.ts` can be transpiled to JavaScript by running `tsc` in this folder (of course you need TypeScript installed).
|
`gflib.ts` can be transpiled to JavaScript by running `tsc` in this folder (of course you need TypeScript installed).
|
||||||
It has no module depenedencies.
|
It has no module dependencies.
|
||||||
You can then include the generated `gflib.js` file in your application as usual.
|
You can then include the generated `js/gflib.js` file in your application as usual.
|
||||||
|
|
||||||
|
_This generated JavaScript version is also included under version control,
|
||||||
|
to make it easy for someone to use without having to install TypeScript._
|
||||||
|
|
||||||
Your GF grammar should be compiled with: `gf --make --output-format=js`
|
Your GF grammar should be compiled with: `gf --make --output-format=js`
|
||||||
|
|
||||||
|
For an example of a working web application using the JavaScript runtime, see `../javascript`.
|
||||||
|
|
||||||
## What happened to `gflib.d.ts`?
|
## What happened to `gflib.d.ts`?
|
||||||
|
|
||||||
There was once a file here called `gflib.d.ts`, which contained TypeScript type definitions for the **old** `gflib.js`.
|
There was once a file here called `gflib.d.ts`, which contained TypeScript type definitions for the **old** `gflib.js`.
|
||||||
|
|||||||
Reference in New Issue
Block a user