TypeScript Collections 项目教程

TypeScript Collections 项目教程

typescript-collectionsA generically typed set of collections for use with TypeScript项目地址:https://gitcode.com/gh_mirrors/ty/typescript-collections

1. 项目的目录结构及介绍

TypeScript Collections 项目的目录结构如下:

typescript-collections/
├── dist/
├── examples/
├── lib/
├── src/
├── test/
├── .gitignore
├── .npmignore
├── .travis.yml
├── LICENSE
├── package.json
├── README.md
├── tsconfig.json
└── tslint.json

目录介绍

  • dist/: 编译后的 JavaScript 文件存放目录。
  • examples/: 项目使用示例代码。
  • lib/: 库文件存放目录。
  • src/: TypeScript 源代码存放目录。
  • test/: 测试代码存放目录。
  • .gitignore: Git 忽略文件配置。
  • .npmignore: npm 发布时忽略的文件配置。
  • .travis.yml: Travis CI 配置文件。
  • LICENSE: 项目许可证。
  • package.json: 项目依赖和脚本配置。
  • README.md: 项目说明文档。
  • tsconfig.json: TypeScript 编译配置文件。
  • tslint.json: TypeScript 代码风格检查配置文件。

2. 项目的启动文件介绍

TypeScript Collections 项目的启动文件主要是 src/index.ts,它是项目的入口文件,负责导出所有可供外部使用的模块和类。

// src/index.ts
export * from './lib/Bag';
export * from './lib/BSTree';
export * from './lib/Dictionary';
export * from './lib/LinkedDictionary';
export * from './lib/LinkedList';
export * from './lib/MultiDictionary';
export * from './lib/Queue';
export * from './lib/PriorityQueue';
export * from './lib/Set';
export * from './lib/Stack';
export * from './lib/Heap';
export * from './lib/TreeSet';

3. 项目的配置文件介绍

tsconfig.json

tsconfig.json 文件是 TypeScript 项目的编译配置文件,定义了 TypeScript 编译器的行为。

{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es5",
    "outDir": "./dist",
    "rootDir": "./src",
    "declaration": true,
    "sourceMap": true,
    "strict": true,
    "esModuleInterop": true
  },
  "include": [
    "src/**/*"
  ]
}

package.json

package.json 文件定义了项目的依赖、脚本和其他元数据。

{
  "name": "typescript-collections",
  "version": "1.3.3",
  "description": "A complete, fully tested data structure library written in TypeScript.",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "scripts": {
    "build": "tsc",
    "test": "jest",
    "lint": "tslint -c tslint.json 'src/**/*.ts'"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/basarat/typescript-collections.git"
  },
  "keywords": [
    "typescript",
    "data",
    "structure",
    "collection",
    "linked",
    "list",
    "dictionary",
    "set",
    "stack",
    "queue",
    "priority",
    "tree",
    "binary",
    "search"
  ],
  "author": "basarat",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/basarat/typescript-collections/issues"
  },
  "homepage": "https://github.com/basarat/typescript-collections#readme",
  "devDependencies": {
    "@types/jest": "^26.0.20",
    "jest": "^26.6.3",
    "ts-jest": "^26.5.3",
    "tslint": "^6.1.3",
    "typ

typescript-collectionsA generically typed set of collections for use with TypeScript项目地址:https://gitcode.com/gh_mirrors/ty/typescript-collections

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

管翔渊Lacey

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值