|
73 | 73 | "\n", |
74 | 74 | "Highly modularized and extensible application often embodies poorly managed types, SynthKernel breaks the hell by declarative type orchestration via advanced generics.\n", |
75 | 75 | "\n", |
76 | | - "For example, it is common for a module to define some configurable fields that can change the module's runtime behavior. Traditional application often uses a centralized configuration file to store these fields, which breaks the modularity by forcing modules to depend on a centralized configuration file. In SynthKernel, each module contribute their own atomic slices of configuration declaratively to the loader. Then the it merges these slices into a single object.\n", |
| 76 | + "For example, it is common for a module to define some configurable fields that can change the module's runtime behavior. Traditional application often uses a centralized configuration file to store these fields, which breaks the modularity by forcing modules to depend on a centralized configuration file. In SynthKernel, each module contribute their own atomic slices of configuration declaratively to the loader. Then it merges these slices into a single object.\n", |
77 | 77 | "\n", |
78 | 78 | "For example, module A can declare a configuration field like this:\n", |
79 | 79 | "\n", |
|
208 | 208 | "type GeneralObject = object;\n", |
209 | 209 | "type GeneralConstructor = new (...args: General[]) => General;\n", |
210 | 210 | "\n", |
211 | | - "type UnionToIntersection<U> =\n", |
212 | | - "\t(U extends General ? (k: U) => void : never) extends (\n", |
213 | | - "\t\tk: infer I,\n", |
214 | | - "\t) => void ? I\n", |
215 | | - "\t\t: never;\n", |
| 211 | + "type UnionToIntersection<U> = (U extends General ? (k: U) => void : never) extends (\n", |
| 212 | + "\tk: infer I,\n", |
| 213 | + ") => void ? I\n", |
| 214 | + "\t: never;\n", |
216 | 215 | "\n", |
217 | 216 | "type GeneralModuleInput =\n", |
218 | 217 | "\t| ReadonlyArray<GeneralConstructor>\n", |
|
222 | 221 | "\t| ReadonlyArray<T>\n", |
223 | 222 | "\t| ReadonlyArray<InstanceType<T>>;\n", |
224 | 223 | "\n", |
225 | | - "type Instances<T extends GeneralModuleInput> = T extends\n", |
226 | | - "\tReadonlyArray<GeneralConstructor> ? InstanceType<T[number]> : T[number];\n", |
| 224 | + "type Instances<T extends GeneralModuleInput> = T extends ReadonlyArray<GeneralConstructor>\n", |
| 225 | + "\t? InstanceType<T[number]>\n", |
| 226 | + "\t: T[number];\n", |
227 | 227 | "\n", |
228 | 228 | "type Orchestratable<\n", |
229 | 229 | "\tT extends GeneralModuleInput,\n", |
|
0 commit comments