arcanajs 4.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/529.js +2 -0
  2. package/dist/529.js.map +1 -0
  3. package/dist/630.js +3 -0
  4. package/dist/630.js.LICENSE.txt +14 -0
  5. package/dist/630.js.map +1 -0
  6. package/dist/arcanajs.auth.js +3 -0
  7. package/dist/arcanajs.auth.js.LICENSE.txt +14 -0
  8. package/dist/arcanajs.auth.js.map +1 -0
  9. package/dist/arcanajs.js +1 -1
  10. package/dist/arcanajs.js.map +1 -1
  11. package/dist/arcanajs.mail.js +2 -0
  12. package/dist/arcanajs.mail.js.map +1 -0
  13. package/dist/arcanajs.validator.js +2 -0
  14. package/dist/arcanajs.validator.js.map +1 -0
  15. package/dist/arcanox.js +1 -1
  16. package/dist/arcanox.js.map +1 -1
  17. package/dist/cli/commands/dependency.d.ts +1 -0
  18. package/dist/cli/commands/make/Controller.d.ts +3 -0
  19. package/dist/cli/commands/make/Factory.d.ts +2 -0
  20. package/dist/cli/commands/make/Middleware.d.ts +1 -0
  21. package/dist/cli/commands/make/Migration.d.ts +2 -0
  22. package/dist/cli/commands/make/Model.d.ts +2 -0
  23. package/dist/cli/commands/make/Provider.d.ts +1 -0
  24. package/dist/cli/commands/make/Request.d.ts +1 -0
  25. package/dist/cli/commands/make/Seeder.d.ts +2 -0
  26. package/dist/cli/index.js +2 -1
  27. package/dist/cli/index.js.LICENSE.txt +14 -0
  28. package/dist/cli/index.js.map +1 -1
  29. package/dist/cli/utils/toPascalCase.d.ts +1 -0
  30. package/dist/cli/utils/writeFile.d.ts +1 -0
  31. package/dist/lib/arcanox/Model.d.ts +7 -0
  32. package/dist/lib/arcanox/providers/DatabaseProvider.d.ts +9 -4
  33. package/dist/lib/arcanox/schema/Schema.d.ts +11 -0
  34. package/dist/lib/arcanox/types.d.ts +4 -2
  35. package/dist/lib/auth/AuthProvider.d.ts +10 -0
  36. package/dist/lib/auth/JWTService.d.ts +11 -0
  37. package/dist/lib/auth/SessionManager.d.ts +4 -0
  38. package/dist/lib/auth/middleware/AuthMiddleware.d.ts +5 -0
  39. package/dist/lib/auth/middleware/AuthenticatedMiddleware.d.ts +5 -0
  40. package/dist/lib/auth/middleware/GuestMiddleware.d.ts +5 -0
  41. package/dist/lib/auth/middleware/RoleMiddleware.d.ts +7 -0
  42. package/dist/lib/auth/types/AuthConfig.d.ts +24 -0
  43. package/dist/lib/auth/types/JWTPayload.d.ts +10 -0
  44. package/dist/lib/auth/types/index.d.ts +2 -0
  45. package/dist/lib/auth/utils/PasswordHasher.d.ts +16 -0
  46. package/dist/lib/auth/utils/TokenBlacklist.d.ts +9 -0
  47. package/dist/lib/index.arcanox.d.ts +16 -2
  48. package/dist/lib/index.auth.d.ts +11 -0
  49. package/dist/lib/index.client.d.ts +2 -0
  50. package/dist/lib/index.mail.d.ts +8 -0
  51. package/dist/lib/index.server.d.ts +4 -6
  52. package/dist/lib/index.validator.d.ts +6 -0
  53. package/dist/lib/mail/MailProvider.d.ts +10 -0
  54. package/dist/lib/mail/MailService.d.ts +57 -0
  55. package/dist/lib/mail/Mailable.d.ts +106 -0
  56. package/dist/lib/mail/index.d.ts +6 -0
  57. package/dist/lib/mail/queue/MailQueue.d.ts +51 -0
  58. package/dist/lib/mail/queue/index.d.ts +1 -0
  59. package/dist/lib/mail/types/MailConfig.d.ts +146 -0
  60. package/dist/lib/mail/types/index.d.ts +1 -0
  61. package/dist/lib/mail/utils/TemplateRenderer.d.ts +34 -0
  62. package/dist/lib/mail/utils/index.d.ts +1 -0
  63. package/dist/lib/server/ArcanaJSServer.d.ts +14 -41
  64. package/dist/lib/server/Container.d.ts +8 -0
  65. package/dist/lib/server/DynamicRouter.d.ts +1 -1
  66. package/dist/lib/server/Router.d.ts +23 -33
  67. package/dist/lib/server/support/ServiceProvider.d.ts +4 -0
  68. package/dist/lib/validation/Validator.d.ts +55 -0
  69. package/dist/types/express.d.ts +45 -0
  70. package/dist/types/global.d.ts +103 -0
  71. package/package.json +71 -15
  72. package/dist/lib/arcanox/index.d.ts +0 -13
  73. package/dist/lib/server/validation/Validator.d.ts +0 -12
  74. /package/dist/lib/{server/validation → validation}/ValidationException.d.ts +0 -0
@@ -0,0 +1,146 @@
1
+ import { Transporter } from "nodemailer";
2
+ /**
3
+ * Supported mail transport drivers
4
+ */
5
+ export type MailDriver = "smtp" | "sendgrid" | "mailgun" | "ses" | "log";
6
+ /**
7
+ * SMTP Configuration
8
+ */
9
+ export interface SMTPConfig {
10
+ host: string;
11
+ port: number;
12
+ secure?: boolean;
13
+ auth?: {
14
+ user: string;
15
+ pass: string;
16
+ };
17
+ tls?: {
18
+ rejectUnauthorized?: boolean;
19
+ };
20
+ }
21
+ /**
22
+ * SendGrid Configuration
23
+ */
24
+ export interface SendGridConfig {
25
+ apiKey: string;
26
+ }
27
+ /**
28
+ * Mailgun Configuration
29
+ */
30
+ export interface MailgunConfig {
31
+ apiKey: string;
32
+ domain: string;
33
+ host?: string;
34
+ }
35
+ /**
36
+ * AWS SES Configuration
37
+ */
38
+ export interface SESConfig {
39
+ region: string;
40
+ accessKeyId: string;
41
+ secretAccessKey: string;
42
+ sessionToken?: string;
43
+ }
44
+ /**
45
+ * Mail Queue Configuration
46
+ */
47
+ export interface MailQueueConfig {
48
+ enabled: boolean;
49
+ driver: "memory" | "redis";
50
+ redis?: {
51
+ host: string;
52
+ port: number;
53
+ password?: string;
54
+ db?: number;
55
+ };
56
+ retries?: number;
57
+ retryDelay?: number;
58
+ }
59
+ /**
60
+ * Mail Template Configuration
61
+ */
62
+ export interface MailTemplateConfig {
63
+ engine: "ejs" | "handlebars";
64
+ viewsPath: string;
65
+ layoutsPath?: string;
66
+ defaultLayout?: string;
67
+ inlineCss?: boolean;
68
+ }
69
+ /**
70
+ * Default Sender Configuration
71
+ */
72
+ export interface MailFromConfig {
73
+ address: string;
74
+ name?: string;
75
+ }
76
+ /**
77
+ * Main Mail Configuration
78
+ */
79
+ export interface MailConfig {
80
+ /**
81
+ * Default mail driver to use
82
+ */
83
+ default: MailDriver;
84
+ /**
85
+ * Default "from" address and name
86
+ */
87
+ from: MailFromConfig;
88
+ /**
89
+ * SMTP Configuration
90
+ */
91
+ smtp?: SMTPConfig;
92
+ /**
93
+ * SendGrid Configuration
94
+ */
95
+ sendgrid?: SendGridConfig;
96
+ /**
97
+ * Mailgun Configuration
98
+ */
99
+ mailgun?: MailgunConfig;
100
+ /**
101
+ * AWS SES Configuration
102
+ */
103
+ ses?: SESConfig;
104
+ /**
105
+ * Queue Configuration
106
+ */
107
+ queue?: MailQueueConfig;
108
+ /**
109
+ * Template Configuration
110
+ */
111
+ templates?: MailTemplateConfig;
112
+ /**
113
+ * Reply-to address
114
+ */
115
+ replyTo?: MailFromConfig;
116
+ }
117
+ /**
118
+ * Mail Message Options
119
+ */
120
+ export interface MailMessage {
121
+ to: string | string[];
122
+ from?: MailFromConfig;
123
+ subject: string;
124
+ html?: string;
125
+ text?: string;
126
+ cc?: string | string[];
127
+ bcc?: string | string[];
128
+ replyTo?: string;
129
+ attachments?: MailAttachment[];
130
+ headers?: Record<string, string>;
131
+ priority?: "high" | "normal" | "low";
132
+ }
133
+ /**
134
+ * Mail Attachment
135
+ */
136
+ export interface MailAttachment {
137
+ filename: string;
138
+ content?: string | Buffer;
139
+ path?: string;
140
+ contentType?: string;
141
+ cid?: string;
142
+ }
143
+ /**
144
+ * Nodemailer Transporter Type
145
+ */
146
+ export type MailTransporter = Transporter;
@@ -0,0 +1 @@
1
+ export * from "./MailConfig";
@@ -0,0 +1,34 @@
1
+ import { MailTemplateConfig } from "../types";
2
+ /**
3
+ * Template renderer for email views
4
+ */
5
+ export declare class TemplateRenderer {
6
+ private static config?;
7
+ /**
8
+ * Initialize the template renderer
9
+ */
10
+ static init(config: MailTemplateConfig): void;
11
+ /**
12
+ * Render a template to HTML
13
+ */
14
+ static render(templateName: string, data?: Record<string, any>): Promise<{
15
+ html: string;
16
+ text: string;
17
+ }>;
18
+ /**
19
+ * Render EJS template
20
+ */
21
+ private static renderEJS;
22
+ /**
23
+ * Render Handlebars template
24
+ */
25
+ private static renderHandlebars;
26
+ /**
27
+ * Apply layout to rendered content
28
+ */
29
+ private static applyLayout;
30
+ /**
31
+ * Convert HTML to plain text
32
+ */
33
+ private static htmlToText;
34
+ }
@@ -0,0 +1 @@
1
+ export * from "./TemplateRenderer";
@@ -1,7 +1,7 @@
1
1
  import { Express, RequestHandler } from "express";
2
2
  import React from "react";
3
3
  import { ServiceProvider } from "./support/ServiceProvider";
4
- export interface ArcanaJSConfig<TDb = any> {
4
+ export interface ArcanaJSConfig {
5
5
  port?: number | string;
6
6
  views?: Record<string, React.FC<any>>;
7
7
  viewsDir?: string;
@@ -15,49 +15,19 @@ export interface ArcanaJSConfig<TDb = any> {
15
15
  distDir?: string;
16
16
  indexFile?: string;
17
17
  layout?: React.FC<any>;
18
- /** Optional function to establish a DB connection. Should return a Promise resolving to the DB client/connection. */
19
- dbConnect?: () => Promise<TDb> | TDb;
20
18
  /** Automatically register SIGINT/SIGTERM handlers to call stop(). Default: true */
21
19
  autoHandleSignals?: boolean;
20
+ /** Auth configuration */
21
+ auth?: any;
22
+ /** Mail configuration */
23
+ mail?: any;
24
+ /** Database configuration */
25
+ database?: any;
22
26
  /** Service providers to load */
23
27
  providers?: (new (app: ArcanaJSServer) => ServiceProvider)[];
24
28
  }
25
- declare global {
26
- namespace Express {
27
- interface Response {
28
- /**
29
- * Sends a success response with a standard format.
30
- *
31
- * @param data - The data payload to include in the response (default: {}).
32
- * @param message - A descriptive message for the success (default: "Success").
33
- * @param status - The HTTP status code to return (default: 200).
34
- * @returns The Express Response object.
35
- */
36
- success: (data?: string | object | null, message?: string, status?: number) => Response;
37
- /**
38
- * Sends an error response with a standard format.
39
- *
40
- * @param message - A descriptive message for the error (default: "Error").
41
- * @param status - The HTTP status code to return (default: 500).
42
- * @param error - Additional error details or object (default: null).
43
- * @param data - Optional data payload to include in the error response (default: null).
44
- * @returns The Express Response object.
45
- */
46
- error: (message?: string, status?: number, error?: string | object | null, data?: string | object | null) => Response;
47
- /**
48
- * Renders a React page using ArcanaJS SSR.
49
- *
50
- * @param page - The name of the page component to render.
51
- * @param data - Initial data to pass to the page component (default: {}).
52
- * @param params - Route parameters (default: {}).
53
- * @returns The Express Response object.
54
- */
55
- renderPage(page: string, data?: any, params?: Record<string, string>): Response;
56
- }
57
- }
58
- }
59
29
  import { Container } from "./Container";
60
- declare class ArcanaJSServer<TDb = any> {
30
+ declare class ArcanaJSServer {
61
31
  app: Express;
62
32
  container: Container;
63
33
  private config;
@@ -65,14 +35,17 @@ declare class ArcanaJSServer<TDb = any> {
65
35
  private _sigintHandler?;
66
36
  private _sigtermHandler?;
67
37
  private providers;
68
- constructor(config: ArcanaJSConfig<TDb>);
38
+ private initialized;
39
+ constructor(config: ArcanaJSConfig);
40
+ private initializeAsync;
41
+ private loadConfigurations;
69
42
  private registerProviders;
70
43
  private bootProviders;
71
- private initialize;
44
+ private setupMiddleware;
72
45
  private loadViewsFromContext;
73
46
  private loadViewsFromAlias;
74
47
  private discoverViews;
75
- start(): void;
48
+ start(): Promise<void>;
76
49
  /**
77
50
  * Stop the HTTP server and close DB connection if present.
78
51
  */
@@ -22,6 +22,14 @@ export declare class Container {
22
22
  * Resolve a dependency from the container
23
23
  */
24
24
  make<T>(key: string | ClassConstructor<T>): T;
25
+ /**
26
+ * Check if a service is registered in the container
27
+ */
28
+ has(key: string | ClassConstructor): boolean;
29
+ /**
30
+ * Alias for make() - resolve a dependency from the container
31
+ */
32
+ resolve<T>(key: string | ClassConstructor<T>): T;
25
33
  /**
26
34
  * Instantiate a class, resolving its dependencies
27
35
  */
@@ -1,2 +1,2 @@
1
1
  import { NextFunction, Request, Response } from "express";
2
- export declare const createDynamicRouter: (views: Record<string, any>) => (req: Request, res: Response, next: NextFunction) => Express.Response | undefined;
2
+ export declare const createDynamicRouter: (views: Record<string, any>) => (req: Request, res: Response, next: NextFunction) => Response<any, Record<string, any>> | undefined;
@@ -1,65 +1,57 @@
1
- import express, { Router as ExpressRouter } from "express";
1
+ import { Router as ExpressRouter } from "express";
2
2
  /**
3
- * Provides Routing syntax for defining routes with prefixes, middlewares, and groups
3
+ * Provides Routing syntax for defining routes with prefixes, middlewares, and groups for ArcanaJS Framework
4
4
  */
5
- export declare class Router {
5
+ export declare class ArcanaJSRouter {
6
6
  private router;
7
7
  private middlewareStack;
8
8
  private prefixStack;
9
9
  constructor();
10
- /**
11
- * Create a new router instance
12
- */
13
- static create(): Router;
14
10
  /**
15
11
  * Add middleware to the current stack
16
12
  */
17
- middleware(...middleware: any[]): Router;
13
+ middleware(...middleware: any[]): ArcanaJSRouter;
18
14
  /**
19
15
  * Add prefix to the current stack
20
16
  */
21
- prefix(prefix: string): Router;
17
+ prefix(prefix: string): ArcanaJSRouter;
22
18
  /**
23
19
  * Create a route group
24
20
  */
25
- group(callback: (router: Router) => void): Router;
21
+ group(callback: (router: ArcanaJSRouter) => void): ArcanaJSRouter;
26
22
  /**
27
23
  * Define a GET route
28
24
  */
29
- get(path: string, ...args: any[]): Router;
25
+ get(path: string, ...args: any[]): ArcanaJSRouter;
30
26
  /**
31
27
  * Define a POST route
32
28
  */
33
- post(path: string, ...args: any[]): Router;
29
+ post(path: string, ...args: any[]): ArcanaJSRouter;
34
30
  /**
35
31
  * Define a PUT route
36
32
  */
37
- put(path: string, ...args: any[]): Router;
33
+ put(path: string, ...args: any[]): ArcanaJSRouter;
38
34
  /**
39
35
  * Define a DELETE route
40
36
  */
41
- delete(path: string, ...args: any[]): Router;
37
+ delete(path: string, ...args: any[]): ArcanaJSRouter;
42
38
  /**
43
39
  * Define a PATCH route
44
40
  */
45
- patch(path: string, ...args: any[]): Router;
41
+ patch(path: string, ...args: any[]): ArcanaJSRouter;
46
42
  /**
47
43
  * Define an OPTIONS route
48
44
  */
49
- options(path: string, ...args: any[]): Router;
45
+ options(path: string, ...args: any[]): ArcanaJSRouter;
50
46
  /**
51
47
  * Define a resource route
52
48
  * Registers index, create, store, show, edit, update, destroy routes
53
49
  */
54
- resource(path: string, controller: any): Router;
50
+ resource(path: string, controller: any): ArcanaJSRouter;
55
51
  /**
56
52
  * Get the underlying Express router
57
53
  */
58
54
  getRouter(): ExpressRouter;
59
- /**
60
- * Mount this router to an Express app or router
61
- */
62
- mount(app: express.Application | ExpressRouter, basePath?: string): void;
63
55
  /**
64
56
  * Clone the current router instance
65
57
  */
@@ -86,18 +78,16 @@ export declare class Router {
86
78
  */
87
79
  export declare class Route {
88
80
  private static _router;
89
- static create(): Router;
90
- static middleware(...middleware: any[]): Router;
91
- static prefix(prefix: string): Router;
92
- static group(callback: (router: Router) => void): Router;
93
- static get(path: string, ...args: any[]): Router;
94
- static post(path: string, ...args: any[]): Router;
95
- static put(path: string, ...args: any[]): Router;
96
- static delete(path: string, ...args: any[]): Router;
97
- static patch(path: string, ...args: any[]): Router;
98
- static options(path: string, ...args: any[]): Router;
81
+ static middleware(...middleware: any[]): typeof Route;
82
+ static prefix(prefix: string): typeof Route;
83
+ static group(callback: (router: ArcanaJSRouter) => void): typeof Route;
84
+ static get(path: string, ...args: any[]): typeof Route;
85
+ static post(path: string, ...args: any[]): typeof Route;
86
+ static put(path: string, ...args: any[]): typeof Route;
87
+ static delete(path: string, ...args: any[]): typeof Route;
88
+ static patch(path: string, ...args: any[]): typeof Route;
89
+ static options(path: string, ...args: any[]): typeof Route;
90
+ static resource(path: string, controller: any): typeof Route;
99
91
  static getRouter(): ExpressRouter;
100
- static mount(app: express.Application, basePath?: string): void;
101
- static reset(): void;
102
92
  }
103
93
  export default Route;
@@ -10,4 +10,8 @@ export declare abstract class ServiceProvider {
10
10
  * Bootstrap any application services.
11
11
  */
12
12
  boot(): void;
13
+ /**
14
+ * Shutdown any application services.
15
+ */
16
+ shutdown(): Promise<void>;
13
17
  }
@@ -0,0 +1,55 @@
1
+ import type { DatabaseAdapter } from "../arcanox/types";
2
+ export declare class Validator {
3
+ protected data: any;
4
+ protected rules: Record<string, string>;
5
+ protected errors: Record<string, string[]>;
6
+ protected databaseAdapter?: DatabaseAdapter;
7
+ /**
8
+ * Map of custom validator functions.
9
+ */
10
+ private static customValidators;
11
+ /**
12
+ * Register a custom validator.
13
+ */
14
+ static registerValidator(name: string, fn: (value: any, data: any, param?: string) => true | string | Promise<true | string>): void;
15
+ constructor(data: any, rules: Record<string, string>);
16
+ static make(data: any, rules: Record<string, string>): Validator;
17
+ /**
18
+ * Set the database adapter for database validation rules
19
+ */
20
+ setDatabaseAdapter(adapter: DatabaseAdapter): this;
21
+ fails(): Promise<boolean>;
22
+ passes(): Promise<boolean>;
23
+ errors_(): Record<string, string[]>;
24
+ validate(): Promise<Record<string, any>>;
25
+ protected validateRules(): Promise<Record<string, any>>;
26
+ /**
27
+ * Check if any rules require database adapter
28
+ */
29
+ protected needsDatabaseAdapter(): boolean;
30
+ /**
31
+ * Auto-inject database adapter from Container
32
+ */
33
+ protected autoInjectDatabaseAdapter(): Promise<void>;
34
+ protected getValue(field: string): any;
35
+ protected applyRule(field: string, value: any, rule: string): Promise<void>;
36
+ protected validateArrayContent(field: string, array: any[], type: string): Promise<void>;
37
+ protected validateMin(field: string, value: any, param: string): void;
38
+ protected validateMax(field: string, value: any, param: string): void;
39
+ protected isValidJson(value: any): boolean;
40
+ protected isEmpty(value: any): boolean;
41
+ /**
42
+ * Validate unique rule: unique:table,column,ignoreId,ignoreColumn
43
+ * Examples:
44
+ * - unique:users,email
45
+ * - unique:users,email,5 (ignore record with id=5)
46
+ * - unique:users,email,5,user_id (ignore record where user_id=5)
47
+ */
48
+ protected validateUnique(field: string, value: any, param: string): Promise<void>;
49
+ /**
50
+ * Validate exists rule: exists:table,column
51
+ * Example: exists:riads,id
52
+ */
53
+ protected validateExists(field: string, value: any, param: string): Promise<void>;
54
+ protected addError(field: string, message: string): void;
55
+ }
@@ -0,0 +1,45 @@
1
+ import "express-serve-static-core";
2
+
3
+ declare module "express-serve-static-core" {
4
+ interface Response {
5
+ /**
6
+ * Sends a success response with a standard format.
7
+ *
8
+ * @param data - The data payload to include in the response (default: {}).
9
+ * @param message - A descriptive message for the success (default: "Success").
10
+ * @param status - The HTTP status code to return (default: 200).
11
+ * @returns The Express Response object.
12
+ */
13
+ success(
14
+ data?: string | object | null,
15
+ message?: string,
16
+ status?: number
17
+ ): this;
18
+
19
+ /**
20
+ * Sends an error response with a standard format.
21
+ *
22
+ * @param message - A descriptive message for the error (default: "Error").
23
+ * @param status - The HTTP status code to return (default: 500).
24
+ * @param error - Additional error details or object (default: null).
25
+ * @param data - Optional data payload to include in the error response (default: null).
26
+ * @returns The Express Response object.
27
+ */
28
+ error(
29
+ message?: string,
30
+ status?: number,
31
+ error?: string | object | null | undefined | unknown,
32
+ data?: string | object | null
33
+ ): this;
34
+
35
+ /**
36
+ * Renders a React page using ArcanaJS SSR.
37
+ *
38
+ * @param page - The name of the page component to render.
39
+ * @param data - Initial data to pass to the page component (default: {}).
40
+ * @param params - Route parameters (default: {}).
41
+ * @returns The Express Response object.
42
+ */
43
+ renderPage(page: string, data?: any, params?: Record<string, string>): this;
44
+ }
45
+ }
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Global type declarations for ArcanaJS
3
+ * This file provides type support for CSS imports in projects using ArcanaJS
4
+ */
5
+
6
+ /// <reference types="react" />
7
+ /// <reference path="./express.d.ts" />
8
+
9
+ // CSS Module declarations
10
+ declare module "*.css" {
11
+ const content: { [className: string]: string };
12
+ export default content;
13
+ }
14
+
15
+ declare module "*.module.css" {
16
+ const classes: { [key: string]: string };
17
+ export default classes;
18
+ }
19
+
20
+ // SCSS declarations
21
+ declare module "*.scss" {
22
+ const content: { [className: string]: string };
23
+ export default content;
24
+ }
25
+
26
+ declare module "*.module.scss" {
27
+ const classes: { [key: string]: string };
28
+ export default classes;
29
+ }
30
+
31
+ // SASS declarations
32
+ declare module "*.sass" {
33
+ const content: { [className: string]: string };
34
+ export default content;
35
+ }
36
+
37
+ declare module "*.module.sass" {
38
+ const classes: { [key: string]: string };
39
+ export default classes;
40
+ }
41
+
42
+ // LESS declarations
43
+ declare module "*.less" {
44
+ const content: { [className: string]: string };
45
+ export default content;
46
+ }
47
+
48
+ declare module "*.module.less" {
49
+ const classes: { [key: string]: string };
50
+ export default classes;
51
+ }
52
+
53
+ // Image file declarations
54
+ declare module "*.png" {
55
+ const value: string;
56
+ export default value;
57
+ }
58
+
59
+ declare module "*.jpg" {
60
+ const value: string;
61
+ export default value;
62
+ }
63
+
64
+ declare module "*.jpeg" {
65
+ const value: string;
66
+ export default value;
67
+ }
68
+
69
+ declare module "*.gif" {
70
+ const value: string;
71
+ export default value;
72
+ }
73
+
74
+ declare module "*.svg" {
75
+ const value: string;
76
+ export default value;
77
+ }
78
+
79
+ declare module "*.webp" {
80
+ const value: string;
81
+ export default value;
82
+ }
83
+
84
+ // Font file declarations
85
+ declare module "*.woff" {
86
+ const value: string;
87
+ export default value;
88
+ }
89
+
90
+ declare module "*.woff2" {
91
+ const value: string;
92
+ export default value;
93
+ }
94
+
95
+ declare module "*.ttf" {
96
+ const value: string;
97
+ export default value;
98
+ }
99
+
100
+ declare module "*.eot" {
101
+ const value: string;
102
+ export default value;
103
+ }