本文整理汇总了TypeScript中language/Translation.nameOf函数的典型用法代码示例。如果您正苦于以下问题:TypeScript nameOf函数的具体用法?TypeScript nameOf怎么用?TypeScript nameOf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了nameOf函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: pipe
.setRefreshMethod(() => ({
defaultOption: ItemType.None,
options: pipe(tuple(ItemType.None, Translation.nameOf(Dictionary.Item, ItemType.None, false).inContext(TextContext.Title)))
.include(Enums.values(ItemType)
.filter(item => item)
.map(item => tuple(item, Translation.nameOf(Dictionary.Item, item, false).inContext(TextContext.Title)))
.collect(Collectors.toArray)
.sort(([, t1], [, t2]) => Text.toString(t1).localeCompare(Text.toString(t2)))
.values())
.map(([id, t]) => tuple(id, (option: Button) => option.setText(t))),
}))
示例2: tuple
.map(doodad => tuple(
DoodadType[doodad] as keyof typeof DoodadType,
Translation.nameOf(Dictionary.Doodad, doodad, false).inContext(TextContext.Title),
))
示例3: tuple
.map(creature => tuple(
CreatureType[creature] as keyof typeof CreatureType,
Translation.nameOf(Dictionary.Creature, creature, false).inContext(TextContext.Title)
.setFailWith(corpseManager.getName(creature, false).inContext(TextContext.Title)),
))
示例4: tuple
.map(event => tuple(
TileEventType[event] as keyof typeof TileEventType,
Translation.nameOf(Dictionary.TileEvent, event, false).inContext(TextContext.Title),
))
示例5: tuple
.map(item => tuple(item, Translation.nameOf(Dictionary.Item, item, false).inContext(TextContext.Title)))
示例6: tuple
.map(creature => tuple(
CreatureType[creature] as keyof typeof CreatureType,
Translation.nameOf(Dictionary.Creature, creature, false).inContext(TextContext.Title),
))