本文整理匯總了TypeScript中utilities/iterable/Generators.tuple函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript tuple函數的具體用法?TypeScript tuple怎麽用?TypeScript tuple使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了tuple函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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(([id, t]) => tuple(id, (option: Button) => option.setText(t)))),
示例3: tuple
.map(terrain => tuple(
TerrainType[terrain] as keyof typeof TerrainType,
new Translation(Dictionary.Terrain, terrain).inContext(TextContext.Title),
))
示例4: tuple
.map(doodad => tuple(
DoodadType[doodad] as keyof typeof DoodadType,
Translation.nameOf(Dictionary.Doodad, doodad, false).inContext(TextContext.Title),
))
示例5: 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)),
))
示例6: tuple
.map(difficulty => tuple(Difficulty[difficulty], {
translation: new Translation(BalancingTools.INSTANCE.dictionaryDifficulty, difficulty),
onActivate: () => this.setDifficulty(difficulty)
})))
示例7: tuple
.map(event => tuple(
TileEventType[event] as keyof typeof TileEventType,
Translation.nameOf(Dictionary.TileEvent, event, false).inContext(TextContext.Title),
))
示例8: tuple
.map(particle => tuple(particle, Translation.generator(ParticleType[particle])))