-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding entity properties to summarization
- Loading branch information
Showing
4 changed files
with
85 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
export interface EntityBoolProperty { | ||
default: boolean; | ||
name: string; | ||
type: "bool"; | ||
} | ||
|
||
export namespace EntityBoolProperty { | ||
export function is(value: any): value is EntityBoolProperty { | ||
if (typeof value !== "object") return false; | ||
if (value.type !== "bool") return false; | ||
|
||
return true; | ||
} | ||
} | ||
|
||
export interface EntityFloatProperty { | ||
default: number; | ||
name: string; | ||
range: [number, number]; | ||
type: "float"; | ||
} | ||
|
||
export namespace EntityFloatProperty { | ||
export function is(value: any): value is EntityFloatProperty { | ||
if (typeof value !== "object") return false; | ||
if (value.type !== "float") return false; | ||
|
||
return true; | ||
} | ||
} | ||
|
||
export interface EntityIntProperty { | ||
default: number; | ||
name: string; | ||
range: [number, number]; | ||
type: "int"; | ||
} | ||
|
||
export namespace EntityIntProperty { | ||
export function is(value: any): value is EntityIntProperty { | ||
if (typeof value !== "object") return false; | ||
if (value.type !== "int") return false; | ||
|
||
return true; | ||
} | ||
} | ||
|
||
export interface EntityEnumProperty { | ||
client_sync: boolean; | ||
default: string; | ||
name: string; | ||
type: "enum"; | ||
values: string[]; | ||
} | ||
|
||
export namespace EntityEnumProperty { | ||
export function is(value: any): value is EntityEnumProperty { | ||
if (typeof value !== "object") return false; | ||
if (value.type !== "enum") return false; | ||
|
||
return true; | ||
} | ||
} | ||
|
||
export type EntityProperty = EntityBoolProperty | EntityFloatProperty | EntityIntProperty | EntityEnumProperty; |