Skip to content

Commit

Permalink
Finish adding the ident-js-* support
Browse files Browse the repository at this point in the history
  • Loading branch information
mutagene committed Dec 29, 2023
1 parent 4f13084 commit 0582d2e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 9 deletions.
16 changes: 10 additions & 6 deletions docs/cli-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ djinni \
| `--wasm-base-lib-include-prefix` | The path prefix to be added to djinni support library inlcude lines in generated files |
| `--ts-out <out-folder>` | Path to the Typescript type definitions output folder |
| `--ts-module <module>` | Name of the module for the Typescript types. `module.ts` by default. |
| `--ts-support-files-out <out-folder>` | Path for where the support files `DjinniModule.[js|ts]` should be generated. No support files are generated if the path is not specified. |
| `--ts-support-files-out <out-folder>` | Path for where the support files `DjinniModule.[js\|ts]` should be generated. No support files are generated if the path is not specified. |


### Yaml Generation
Expand Down Expand Up @@ -244,11 +244,15 @@ Possible values: `FooBar`, `fooBar`, `foo_bar`, `FOO_BAR`, `m_fooBar`.

#### Javascript / Typescript

| Argument | Default |
|----------------------|-----------|
| `--ident-js-enum` | `FOO_BAR` |
| `--ident-js-field` | `fooBar` |
| `--ident-js-type` | `FooBar` |
| Argument | Default |
|-------------------------|-----------|
| `--ident-js-type` | `FooBar` |
| `--ident-js-type-param` | `FooBar` |
| `--ident-js-method` | `fooBar` |
| `--ident-js-local` | `fooBar` |
| `--ident-js-enum` | `FOO_BAR` |
| `--ident-js-const` | `FOO_BAR` |
| `--ident-js-field` | `fooBar` |


Example:
Expand Down
26 changes: 23 additions & 3 deletions src/main/scala/djinni/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,26 @@ object Main {
)

note("\nTypescript/Javascript options:")
identStyle(
"ident-js-type",
"FooBar",
c => { jsIdentStyle = jsIdentStyle.copy(ty = c) }
)
identStyle(
"ident-js-type-param",
"FooBar",
c => { jsIdentStyle = jsIdentStyle.copy(typeParam = c) }
)
identStyle(
"ident-js-method",
"fooBar",
c => { jsIdentStyle = jsIdentStyle.copy(method = c) }
)
identStyle(
"ident-js-local",
"fooBar",
c => { jsIdentStyle = jsIdentStyle.copy(local = c) }
)
identStyle(
"ident-js-enum",
"FOO_BAR",
Expand All @@ -815,9 +835,9 @@ object Main {
c => { jsIdentStyle = jsIdentStyle.copy(field = c) }
)
identStyle(
"ident-js-type",
"FooBar",
c => { jsIdentStyle = jsIdentStyle.copy(ty = c) }
"ident-js-const",
"FOO_BAR",
c => { jsIdentStyle = jsIdentStyle.copy(const = c) }
)
}

Expand Down

0 comments on commit 0582d2e

Please sign in to comment.