├── .gitignore ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── chapter-1 ├── package.json ├── src │ ├── index.ts │ └── test │ │ └── starter.ts ├── test │ ├── mocha.js │ └── mocha.opts ├── tsconfig.json └── typings │ ├── assertion-error │ └── assertion-error.d.ts │ ├── chai │ └── chai.d.ts │ └── mocha │ └── mocha.d.ts ├── chapter-2 ├── src │ ├── after │ │ ├── client.ts │ │ ├── global.d.ts │ │ ├── index.ts │ │ ├── server.ts │ │ ├── shared.d.ts │ │ └── strategies │ │ │ ├── increment.ts │ │ │ └── value.ts │ └── before │ │ ├── client.ts │ │ ├── index.ts │ │ ├── server.ts │ │ └── shared.d.ts └── tsconfig.json ├── chapter-3 ├── src │ ├── abstract-factory.ts │ ├── builder.ts │ ├── factory-method.ts │ └── singleton.ts └── tsconfig.json ├── chapter-4 ├── src │ ├── adapter.ts │ ├── bridge.ts │ ├── composite.ts │ ├── decorator.ts │ ├── facade.ts │ ├── flyweight.ts │ └── proxy.ts ├── tsconfig.json └── typings │ └── node │ └── node.d.ts ├── chapter-5 ├── src │ ├── chain-of-responsibility.ts │ ├── command.ts │ ├── iterator.ts │ ├── mediator.ts │ └── momento.ts ├── tsconfig.json └── typings │ └── jquery │ └── jquery.d.ts ├── chapter-6 ├── src │ ├── observer.ts │ ├── state.ts │ ├── strategy.ts │ ├── template-method.ts │ └── visitor.ts ├── tsconfig.json └── typings │ ├── form-data │ └── form-data.d.ts │ ├── jquery │ └── jquery.d.ts │ ├── node │ └── node.d.ts │ └── request │ └── request.d.ts ├── chapter-7 ├── src │ ├── event-based-parser.ts │ └── middleware.ts ├── tsconfig.json └── typings │ └── node │ └── node.d.ts └── package.json /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/.gitignore -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/.vscode/settings.json -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/README.md -------------------------------------------------------------------------------- /chapter-1/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-1/package.json -------------------------------------------------------------------------------- /chapter-1/src/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-1/src/index.ts -------------------------------------------------------------------------------- /chapter-1/src/test/starter.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-1/src/test/starter.ts -------------------------------------------------------------------------------- /chapter-1/test/mocha.js: -------------------------------------------------------------------------------- 1 | require('chai').should(); 2 | -------------------------------------------------------------------------------- /chapter-1/test/mocha.opts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-1/test/mocha.opts -------------------------------------------------------------------------------- /chapter-1/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-1/tsconfig.json -------------------------------------------------------------------------------- /chapter-1/typings/assertion-error/assertion-error.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-1/typings/assertion-error/assertion-error.d.ts -------------------------------------------------------------------------------- /chapter-1/typings/chai/chai.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-1/typings/chai/chai.d.ts -------------------------------------------------------------------------------- /chapter-1/typings/mocha/mocha.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-1/typings/mocha/mocha.d.ts -------------------------------------------------------------------------------- /chapter-2/src/after/client.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-2/src/after/client.ts -------------------------------------------------------------------------------- /chapter-2/src/after/global.d.ts: -------------------------------------------------------------------------------- 1 | interface HashTable { 2 | [key: string]: T; 3 | } 4 | -------------------------------------------------------------------------------- /chapter-2/src/after/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-2/src/after/index.ts -------------------------------------------------------------------------------- /chapter-2/src/after/server.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-2/src/after/server.ts -------------------------------------------------------------------------------- /chapter-2/src/after/shared.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-2/src/after/shared.d.ts -------------------------------------------------------------------------------- /chapter-2/src/after/strategies/increment.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-2/src/after/strategies/increment.ts -------------------------------------------------------------------------------- /chapter-2/src/after/strategies/value.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-2/src/after/strategies/value.ts -------------------------------------------------------------------------------- /chapter-2/src/before/client.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-2/src/before/client.ts -------------------------------------------------------------------------------- /chapter-2/src/before/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-2/src/before/index.ts -------------------------------------------------------------------------------- /chapter-2/src/before/server.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-2/src/before/server.ts -------------------------------------------------------------------------------- /chapter-2/src/before/shared.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-2/src/before/shared.d.ts -------------------------------------------------------------------------------- /chapter-2/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-2/tsconfig.json -------------------------------------------------------------------------------- /chapter-3/src/abstract-factory.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-3/src/abstract-factory.ts -------------------------------------------------------------------------------- /chapter-3/src/builder.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-3/src/builder.ts -------------------------------------------------------------------------------- /chapter-3/src/factory-method.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-3/src/factory-method.ts -------------------------------------------------------------------------------- /chapter-3/src/singleton.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-3/src/singleton.ts -------------------------------------------------------------------------------- /chapter-3/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-3/tsconfig.json -------------------------------------------------------------------------------- /chapter-4/src/adapter.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-4/src/adapter.ts -------------------------------------------------------------------------------- /chapter-4/src/bridge.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-4/src/bridge.ts -------------------------------------------------------------------------------- /chapter-4/src/composite.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-4/src/composite.ts -------------------------------------------------------------------------------- /chapter-4/src/decorator.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-4/src/decorator.ts -------------------------------------------------------------------------------- /chapter-4/src/facade.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-4/src/facade.ts -------------------------------------------------------------------------------- /chapter-4/src/flyweight.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-4/src/flyweight.ts -------------------------------------------------------------------------------- /chapter-4/src/proxy.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-4/src/proxy.ts -------------------------------------------------------------------------------- /chapter-4/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-4/tsconfig.json -------------------------------------------------------------------------------- /chapter-4/typings/node/node.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-4/typings/node/node.d.ts -------------------------------------------------------------------------------- /chapter-5/src/chain-of-responsibility.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-5/src/chain-of-responsibility.ts -------------------------------------------------------------------------------- /chapter-5/src/command.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-5/src/command.ts -------------------------------------------------------------------------------- /chapter-5/src/iterator.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-5/src/iterator.ts -------------------------------------------------------------------------------- /chapter-5/src/mediator.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-5/src/mediator.ts -------------------------------------------------------------------------------- /chapter-5/src/momento.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-5/src/momento.ts -------------------------------------------------------------------------------- /chapter-5/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-5/tsconfig.json -------------------------------------------------------------------------------- /chapter-5/typings/jquery/jquery.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-5/typings/jquery/jquery.d.ts -------------------------------------------------------------------------------- /chapter-6/src/observer.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-6/src/observer.ts -------------------------------------------------------------------------------- /chapter-6/src/state.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-6/src/state.ts -------------------------------------------------------------------------------- /chapter-6/src/strategy.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-6/src/strategy.ts -------------------------------------------------------------------------------- /chapter-6/src/template-method.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-6/src/template-method.ts -------------------------------------------------------------------------------- /chapter-6/src/visitor.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-6/src/visitor.ts -------------------------------------------------------------------------------- /chapter-6/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-6/tsconfig.json -------------------------------------------------------------------------------- /chapter-6/typings/form-data/form-data.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-6/typings/form-data/form-data.d.ts -------------------------------------------------------------------------------- /chapter-6/typings/jquery/jquery.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-6/typings/jquery/jquery.d.ts -------------------------------------------------------------------------------- /chapter-6/typings/node/node.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-6/typings/node/node.d.ts -------------------------------------------------------------------------------- /chapter-6/typings/request/request.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-6/typings/request/request.d.ts -------------------------------------------------------------------------------- /chapter-7/src/event-based-parser.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-7/src/event-based-parser.ts -------------------------------------------------------------------------------- /chapter-7/src/middleware.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-7/src/middleware.ts -------------------------------------------------------------------------------- /chapter-7/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-7/tsconfig.json -------------------------------------------------------------------------------- /chapter-7/typings/node/node.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/chapter-7/typings/node/node.d.ts -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/TypeScript-Design-Patterns/HEAD/package.json --------------------------------------------------------------------------------