Skip to content

hangboss1761/ts-type-playground

Repository files navigation

TypeScript 类型体操练习


介绍

通过题目练习,让自己更好的了解与掌握TS的类型系统

题库来源

运行

第一步:安装必要依赖 pnpm i

第二步:选择题目,点击标签->接受挑战->将网站内容粘贴到项目playground目录下(命名推荐./4-Pick.ts

建议按难度从低到高开始

题库

点击下方徽章查看题目内容

13

  • 4・实现 Pick
  • 7・实现 Readonly
  • 11・元组转换为对象
  • 14・第一个元素
  • 18・获取元组长度
  • 43・Exclude
  • 189・Awaited
  • 268・If
  • 533・Concat
  • 898・Includes
  • 3057・Push
  • 3060・Unshift
  • 3312・Parameters

65

  • 2・获取函数返回类型
  • 3・实现 Omit
  • 8・Readonly 2
  • 9・深度 Readonly
  • 10・元组转合集
  • 12・可串联构造器
  • 15・最后一个元素
  • 16・出堆
  • 20・Promise.all
  • 62・Type Lookup
  • 106・Trim Left
  • 108・Trim
  • 110・Capitalize
  • 116・Replace
  • 119・ReplaceAll
  • 191・追加参数
  • 296・Permutation
  • 298・Length of String
  • 459・Flatten
  • 527・Append to object
  • 529・Absolute
  • 531・String to Union
  • 599・Merge
  • 610・CamelCase
  • 612・KebabCase
  • 645・Diff
  • 949・AnyOf
  • 1042・IsNever
  • 1097・IsUnion
  • 1130・ReplaceKeys
  • 1367・Remove Index Signature
  • 1978・Percentage Parser
  • 2070・Drop Char
  • 2257・MinusOne
  • 2595・PickByType
  • 2688・StartsWith
  • 2693・EndsWith
  • 2757・PartialByKeys
  • 2759・RequiredByKeys
  • 2793・Mutable
  • 2852・OmitByType
  • 2946・ObjectEntries
  • 3062・Shift
  • 3188・Tuple to Nested Object
  • 3192・Reverse
  • 3196・Flip Arguments
  • 3243・FlattenDepth
  • 3326・BEM style string
  • 3376・InorderTraversal
  • 4179・Flip
  • 4182・斐波那契序列
  • 4260・AllCombinations
  • 4425・Greater Than
  • 4471・Zip
  • 4484・IsTuple
  • 4499・Chunk
  • 4518・Fill
  • 4803・Trim Right
  • 5117・去除数组指定元素
  • 5140・Trunc
  • 5153・IndexOf
  • 5310・Join
  • 5317・LastIndexOf
  • 5360・Unique
  • 5821・MapTypes

33

  • 6・简单的 Vue 类型
  • 17・柯里化 1
  • 55・Union to Intersection
  • 57・Get Required
  • 59・Get Optional
  • 89・Required Keys
  • 90・Optional Keys
  • 112・Capitalize Words
  • 114・CamelCase
  • 147・C-printf Parser
  • 213・Vue Basic Props
  • 223・IsAny
  • 270・Typed Get
  • 300・String to Number
  • 399・Tuple Filter
  • 472・Tuple to Enum Object
  • 545・printf
  • 553・Deep object to unique
  • 651・Length of String 2
  • 730・Union to Tuple
  • 847・String Join
  • 956・DeepPick
  • 1290・Pinia
  • 1383・Camelize
  • 2059・Drop String
  • 2822・Split
  • 2828・ClassPublicKeys
  • 2857・IsRequiredKey
  • 2949・ObjectFromEntries
  • 4037・IsPalindrome
  • 5181・Mutable Keys
  • 5423・Intersection
  • 6141・Binary to Decimal

13

  • 5・获取只读字段
  • 151・Query String Parser
  • 216・Slice
  • 274・Integers Comparator
  • 462・柯里化 2
  • 476・Sum
  • 517・Multiply
  • 697・Tag
  • 734・Inclusive Range
  • 741・Sort
  • 869・DistributeUnions
  • 925・Assert Array Index
  • 6228・JSON Parser

即将到来的新题目

题目分类

By Tags
#application12・可串联构造器 6・简单的 Vue 类型 213・Vue Basic Props
#arguments191・追加参数 3196・Flip Arguments
#array14・第一个元素 533・Concat 898・Includes 3057・Push 3060・Unshift 15・最后一个元素 16・出堆 20・Promise.all 459・Flatten 949・AnyOf 3062・Shift 3243・FlattenDepth 4425・Greater Than 5153・IndexOf 5310・Join 5317・LastIndexOf 5360・Unique 17・柯里化 1 2822・Split 5423・Intersection 216・Slice 734・Inclusive Range 741・Sort 925・Assert Array Index
#built-in4・实现 Pick 7・实现 Readonly 43・Exclude 189・Awaited 3312・Parameters 2・获取函数返回类型 3・实现 Omit 20・Promise.all
#deep9・深度 Readonly 553・Deep object to unique 956・DeepPick
#infer3312・Parameters 2・获取函数返回类型 10・元组转合集 2070・Drop Char 55・Union to Intersection 57・Get Required 59・Get Optional 399・Tuple Filter 730・Union to Tuple 2059・Drop String 734・Inclusive Range 741・Sort
#map62・Type Lookup 5821・MapTypes
#math529・Absolute 2257・MinusOne 6141・Binary to Decimal 274・Integers Comparator 476・Sum 517・Multiply
#object599・Merge 645・Diff 2595・PickByType 2757・PartialByKeys 2759・RequiredByKeys 2852・OmitByType 2946・ObjectEntries 3188・Tuple to Nested Object 3376・InorderTraversal 4179・Flip 5821・MapTypes 2949・ObjectFromEntries
#object-keys7・实现 Readonly 8・Readonly 2 9・深度 Readonly 527・Append to object 2793・Mutable 5・获取只读字段
#promise189・Awaited
#readonly7・实现 Readonly 8・Readonly 2 9・深度 Readonly 2793・Mutable
#recursion1383・Camelize
#split2822・Split
#string531・String to Union 2822・Split 4037・IsPalindrome
#template-literal106・Trim Left 108・Trim 110・Capitalize 116・Replace 119・ReplaceAll 298・Length of String 529・Absolute 610・CamelCase 612・KebabCase 2070・Drop Char 2688・StartsWith 2693・EndsWith 3326・BEM style string 5140・Trunc 112・Capitalize Words 114・CamelCase 147・C-printf Parser 270・Typed Get 300・String to Number 472・Tuple to Enum Object 545・printf 651・Length of String 2 2059・Drop String 151・Query String Parser 274・Integers Comparator 476・Sum 517・Multiply
#template-literal json6228・JSON Parser
#this6・简单的 Vue 类型 1290・Pinia
#tuple18・获取元组长度 3312・Parameters 10・元组转合集 3192・Reverse 3326・BEM style string 4471・Zip 4484・IsTuple 4499・Chunk 4518・Fill 399・Tuple Filter 472・Tuple to Enum Object 730・Union to Tuple 2822・Split
#union4・实现 Pick 3・实现 Omit 10・元组转合集 62・Type Lookup 296・Permutation 531・String to Union 1042・IsNever 3326・BEM style string 730・Union to Tuple 1383・Camelize 5423・Intersection
#utils268・If 1042・IsNever 5821・MapTypes 55・Union to Intersection 57・Get Required 59・Get Optional 89・Required Keys 90・Optional Keys 223・IsAny 270・Typed Get 2828・ClassPublicKeys 2857・IsRequiredKey 5181・Mutable Keys 5・获取只读字段
#vue6・简单的 Vue 类型 213・Vue Basic Props 1290・Pinia
#数组5117・去除数组指定元素
#联合类型5117・去除数组指定元素
          

官方资源 (英文)

License

MIT

About

Typescript类型编程练习

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published