schema.d.ts 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. export interface Schema {
  2. $schema?: string;
  3. cli?: CliOptions;
  4. /**
  5. * Default project name used in commands.
  6. */
  7. defaultProject?: string;
  8. /**
  9. * Path where new projects will be created.
  10. */
  11. newProjectRoot?: string;
  12. projects?: Projects;
  13. schematics?: SchematicOptions;
  14. version: number;
  15. }
  16. export interface CliOptions {
  17. /**
  18. * Share anonymous usage data with the Angular Team at Google.
  19. */
  20. analytics?: boolean;
  21. /**
  22. * The default schematics collection to use.
  23. */
  24. defaultCollection?: string;
  25. /**
  26. * Specify which package manager tool to use.
  27. */
  28. packageManager?: PackageManager;
  29. /**
  30. * Control CLI specific console warnings
  31. */
  32. warnings?: Warnings;
  33. }
  34. /**
  35. * Specify which package manager tool to use.
  36. */
  37. export declare enum PackageManager {
  38. Cnpm = "cnpm",
  39. Npm = "npm",
  40. Pnpm = "pnpm",
  41. Yarn = "yarn"
  42. }
  43. /**
  44. * Control CLI specific console warnings
  45. */
  46. export interface Warnings {
  47. /**
  48. * Show a warning when the TypeScript version is incompatible.
  49. */
  50. typescriptMismatch?: boolean;
  51. /**
  52. * Show a warning when the global version is newer than the local one.
  53. */
  54. versionMismatch?: boolean;
  55. }
  56. export interface Projects {
  57. }
  58. export interface SchematicOptions {
  59. "@schematics/angular:class"?: SchematicsAngularClass;
  60. "@schematics/angular:component"?: SchematicsAngularComponent;
  61. "@schematics/angular:directive"?: SchematicsAngularDirective;
  62. "@schematics/angular:module"?: SchematicsAngularModule;
  63. "@schematics/angular:pipe"?: SchematicsAngularPipe;
  64. "@schematics/angular:service"?: SchematicsAngularService;
  65. }
  66. export interface SchematicsAngularClass {
  67. /**
  68. * When true, does not create test files.
  69. */
  70. skipTests?: boolean;
  71. /**
  72. * Specifies if a spec file is generated.
  73. */
  74. spec?: boolean;
  75. }
  76. export interface SchematicsAngularComponent {
  77. /**
  78. * Specifies the change detection strategy.
  79. */
  80. changeDetection?: ChangeDetection;
  81. /**
  82. * Specifies if the component is an entry component of declaring module.
  83. */
  84. entryComponent?: boolean;
  85. /**
  86. * Specifies if declaring module exports the component.
  87. */
  88. export?: boolean;
  89. /**
  90. * Flag to indicate if a directory is created.
  91. */
  92. flat?: boolean;
  93. /**
  94. * Specifies if the style will be in the ts file.
  95. */
  96. inlineStyle?: boolean;
  97. /**
  98. * Specifies if the template will be in the ts file.
  99. */
  100. inlineTemplate?: boolean;
  101. /**
  102. * Allows specification of the declaring module.
  103. */
  104. module?: string;
  105. /**
  106. * The prefix to apply to generated selectors.
  107. */
  108. prefix?: string;
  109. /**
  110. * The selector to use for the component.
  111. */
  112. selector?: string;
  113. /**
  114. * Flag to skip the module import.
  115. */
  116. skipImport?: boolean;
  117. /**
  118. * Specifies if a spec file is generated.
  119. */
  120. spec?: boolean;
  121. /**
  122. * The file extension or preprocessor to use for style files.
  123. */
  124. style?: Style;
  125. /**
  126. * The file extension to be used for style files.
  127. */
  128. styleext?: string;
  129. /**
  130. * Specifies the view encapsulation strategy.
  131. */
  132. viewEncapsulation?: ViewEncapsulation;
  133. }
  134. /**
  135. * Specifies the change detection strategy.
  136. */
  137. export declare enum ChangeDetection {
  138. Default = "Default",
  139. OnPush = "OnPush"
  140. }
  141. /**
  142. * The file extension or preprocessor to use for style files.
  143. */
  144. export declare enum Style {
  145. Css = "css",
  146. Less = "less",
  147. Sass = "sass",
  148. Scss = "scss",
  149. Styl = "styl"
  150. }
  151. /**
  152. * Specifies the view encapsulation strategy.
  153. */
  154. export declare enum ViewEncapsulation {
  155. Emulated = "Emulated",
  156. Native = "Native",
  157. None = "None",
  158. ShadowDom = "ShadowDom"
  159. }
  160. export interface SchematicsAngularDirective {
  161. /**
  162. * Specifies if declaring module exports the directive.
  163. */
  164. export?: boolean;
  165. /**
  166. * Flag to indicate if a directory is created.
  167. */
  168. flat?: boolean;
  169. /**
  170. * Allows specification of the declaring module.
  171. */
  172. module?: string;
  173. /**
  174. * The prefix to apply to generated selectors.
  175. */
  176. prefix?: string;
  177. /**
  178. * The selector to use for the directive.
  179. */
  180. selector?: string;
  181. /**
  182. * Flag to skip the module import.
  183. */
  184. skipImport?: boolean;
  185. /**
  186. * When true, does not create test files.
  187. */
  188. skipTests?: boolean;
  189. /**
  190. * Specifies if a spec file is generated.
  191. */
  192. spec?: boolean;
  193. }
  194. export interface SchematicsAngularModule {
  195. /**
  196. * Flag to control whether the CommonModule is imported.
  197. */
  198. commonModule?: boolean;
  199. /**
  200. * Flag to indicate if a directory is created.
  201. */
  202. flat?: boolean;
  203. /**
  204. * Allows specification of the declaring module.
  205. */
  206. module?: string;
  207. /**
  208. * Generates a routing module.
  209. */
  210. routing?: boolean;
  211. /**
  212. * The scope for the generated routing.
  213. */
  214. routingScope?: RoutingScope;
  215. }
  216. /**
  217. * The scope for the generated routing.
  218. */
  219. export declare enum RoutingScope {
  220. Child = "Child",
  221. Root = "Root"
  222. }
  223. export interface SchematicsAngularPipe {
  224. /**
  225. * Specifies if declaring module exports the pipe.
  226. */
  227. export?: boolean;
  228. /**
  229. * Flag to indicate if a directory is created.
  230. */
  231. flat?: boolean;
  232. /**
  233. * Allows specification of the declaring module.
  234. */
  235. module?: string;
  236. /**
  237. * Allows for skipping the module import.
  238. */
  239. skipImport?: boolean;
  240. /**
  241. * When true, does not create test files.
  242. */
  243. skipTests?: boolean;
  244. /**
  245. * Specifies if a spec file is generated.
  246. */
  247. spec?: boolean;
  248. }
  249. export interface SchematicsAngularService {
  250. /**
  251. * Flag to indicate if a directory is created.
  252. */
  253. flat?: boolean;
  254. /**
  255. * When true, does not create test files.
  256. */
  257. skipTests?: boolean;
  258. /**
  259. * Specifies if a spec file is generated.
  260. */
  261. spec?: boolean;
  262. }