[TS] Make strict compliant and improve typings (#7549)

* [TS] Make strict compliant and improve typings

* clang-format

* Code gen harmonize

Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
Björn Harrtell
2022-09-30 00:03:35 +02:00
committed by GitHub
parent 374f8fb5fb
commit d243b904cc
41 changed files with 279 additions and 268 deletions

View File

@@ -549,7 +549,7 @@ export class Builder {
*
* @returns offset of obj
*/
createObjectOffset(obj: string | any): Offset {
createObjectOffset(obj: string | IGeneratedObject | null): Offset {
if(obj === null) {
return 0
}
@@ -566,7 +566,7 @@ export class Builder {
*
* @returns list of offsets of each non null object
*/
createObjectOffsetList(list: string[] | any[]): Offset[] {
createObjectOffsetList(list: (string | IGeneratedObject)[]): Offset[] {
const ret: number[] = [];
for(let i = 0; i < list.length; ++i) {
@@ -583,7 +583,7 @@ export class Builder {
return ret;
}
createStructOffsetList(list: string[] | any[], startFunc: (builder: Builder, length: number) => void): Offset {
createStructOffsetList(list: (string | IGeneratedObject)[], startFunc: (builder: Builder, length: number) => void): Offset {
startFunc(this, list.length);
this.createObjectOffsetList(list.slice().reverse());
return this.endVector();