@canva/cli 0.0.1-beta.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 (109) hide show
  1. package/LICENSE.md +48 -0
  2. package/README.md +206 -0
  3. package/cli.js +566 -0
  4. package/package.json +30 -0
  5. package/templates/base/backend/database/database.ts +42 -0
  6. package/templates/base/backend/routers/auth.ts +285 -0
  7. package/templates/base/declarations/declarations.d.ts +29 -0
  8. package/templates/base/eslint.config.mjs +309 -0
  9. package/templates/base/package.json +83 -0
  10. package/templates/base/scripts/ssl/ssl.ts +131 -0
  11. package/templates/base/scripts/start/app_runner.ts +164 -0
  12. package/templates/base/scripts/start/context.ts +165 -0
  13. package/templates/base/scripts/start/start.ts +35 -0
  14. package/templates/base/styles/components.css +38 -0
  15. package/templates/base/tsconfig.json +54 -0
  16. package/templates/base/utils/backend/base_backend/create.ts +104 -0
  17. package/templates/base/utils/backend/jwt_middleware/index.ts +1 -0
  18. package/templates/base/utils/backend/jwt_middleware/jwt_middleware.ts +229 -0
  19. package/templates/base/utils/backend/jwt_middleware/tests/jwt_middleware.tests.ts +630 -0
  20. package/templates/base/webpack.config.cjs +270 -0
  21. package/templates/common/.env.template +6 -0
  22. package/templates/common/.gitignore.template +9 -0
  23. package/templates/common/LICENSE.md +48 -0
  24. package/templates/common/README.md +250 -0
  25. package/templates/common/jest.config.mjs +8 -0
  26. package/templates/dam/backend/database/database.ts +42 -0
  27. package/templates/dam/backend/routers/auth.ts +285 -0
  28. package/templates/dam/backend/routers/dam.ts +86 -0
  29. package/templates/dam/backend/server.ts +65 -0
  30. package/templates/dam/declarations/declarations.d.ts +29 -0
  31. package/templates/dam/eslint.config.mjs +309 -0
  32. package/templates/dam/package.json +90 -0
  33. package/templates/dam/scripts/ssl/ssl.ts +131 -0
  34. package/templates/dam/scripts/start/app_runner.ts +164 -0
  35. package/templates/dam/scripts/start/context.ts +165 -0
  36. package/templates/dam/scripts/start/start.ts +35 -0
  37. package/templates/dam/src/adapter.ts +44 -0
  38. package/templates/dam/src/app.tsx +147 -0
  39. package/templates/dam/src/config.ts +95 -0
  40. package/templates/dam/src/index.css +10 -0
  41. package/templates/dam/src/index.tsx +22 -0
  42. package/templates/dam/tsconfig.json +54 -0
  43. package/templates/dam/utils/backend/base_backend/create.ts +104 -0
  44. package/templates/dam/utils/backend/jwt_middleware/index.ts +1 -0
  45. package/templates/dam/utils/backend/jwt_middleware/jwt_middleware.ts +229 -0
  46. package/templates/dam/utils/backend/jwt_middleware/tests/jwt_middleware.tests.ts +630 -0
  47. package/templates/dam/webpack.config.cjs +270 -0
  48. package/templates/gen_ai/README.md +27 -0
  49. package/templates/gen_ai/backend/database/database.ts +42 -0
  50. package/templates/gen_ai/backend/routers/auth.ts +285 -0
  51. package/templates/gen_ai/backend/routers/image.ts +234 -0
  52. package/templates/gen_ai/backend/server.ts +56 -0
  53. package/templates/gen_ai/declarations/declarations.d.ts +29 -0
  54. package/templates/gen_ai/eslint.config.mjs +309 -0
  55. package/templates/gen_ai/package.json +92 -0
  56. package/templates/gen_ai/scripts/ssl/ssl.ts +131 -0
  57. package/templates/gen_ai/scripts/start/app_runner.ts +164 -0
  58. package/templates/gen_ai/scripts/start/context.ts +165 -0
  59. package/templates/gen_ai/scripts/start/start.ts +35 -0
  60. package/templates/gen_ai/src/api/api.ts +228 -0
  61. package/templates/gen_ai/src/api/index.ts +1 -0
  62. package/templates/gen_ai/src/app.tsx +13 -0
  63. package/templates/gen_ai/src/components/app_error.tsx +18 -0
  64. package/templates/gen_ai/src/components/footer.messages.ts +53 -0
  65. package/templates/gen_ai/src/components/footer.tsx +157 -0
  66. package/templates/gen_ai/src/components/image_grid.tsx +96 -0
  67. package/templates/gen_ai/src/components/index.ts +8 -0
  68. package/templates/gen_ai/src/components/loading_results.tsx +169 -0
  69. package/templates/gen_ai/src/components/logged_in_status.tsx +44 -0
  70. package/templates/gen_ai/src/components/prompt_input.messages.ts +14 -0
  71. package/templates/gen_ai/src/components/prompt_input.tsx +149 -0
  72. package/templates/gen_ai/src/components/remaining_credits.tsx +75 -0
  73. package/templates/gen_ai/src/components/report_box.tsx +53 -0
  74. package/templates/gen_ai/src/config.ts +21 -0
  75. package/templates/gen_ai/src/context/app_context.tsx +174 -0
  76. package/templates/gen_ai/src/context/context.messages.ts +41 -0
  77. package/templates/gen_ai/src/context/index.ts +2 -0
  78. package/templates/gen_ai/src/context/use_app_context.ts +17 -0
  79. package/templates/gen_ai/src/index.tsx +31 -0
  80. package/templates/gen_ai/src/pages/error.tsx +41 -0
  81. package/templates/gen_ai/src/pages/generate.tsx +9 -0
  82. package/templates/gen_ai/src/pages/index.ts +3 -0
  83. package/templates/gen_ai/src/pages/results.tsx +31 -0
  84. package/templates/gen_ai/src/routes/index.ts +1 -0
  85. package/templates/gen_ai/src/routes/routes.tsx +26 -0
  86. package/templates/gen_ai/src/services/auth.tsx +31 -0
  87. package/templates/gen_ai/src/services/index.ts +1 -0
  88. package/templates/gen_ai/src/utils/index.ts +1 -0
  89. package/templates/gen_ai/src/utils/obscenity_filter.ts +33 -0
  90. package/templates/gen_ai/styles/components.css +38 -0
  91. package/templates/gen_ai/styles/utils.css +3 -0
  92. package/templates/gen_ai/tsconfig.json +54 -0
  93. package/templates/gen_ai/utils/backend/base_backend/create.ts +104 -0
  94. package/templates/gen_ai/utils/backend/jwt_middleware/index.ts +1 -0
  95. package/templates/gen_ai/utils/backend/jwt_middleware/jwt_middleware.ts +229 -0
  96. package/templates/gen_ai/utils/backend/jwt_middleware/tests/jwt_middleware.tests.ts +630 -0
  97. package/templates/gen_ai/webpack.config.cjs +270 -0
  98. package/templates/hello_world/declarations/declarations.d.ts +29 -0
  99. package/templates/hello_world/eslint.config.mjs +309 -0
  100. package/templates/hello_world/package.json +73 -0
  101. package/templates/hello_world/scripts/ssl/ssl.ts +131 -0
  102. package/templates/hello_world/scripts/start/app_runner.ts +164 -0
  103. package/templates/hello_world/scripts/start/context.ts +165 -0
  104. package/templates/hello_world/scripts/start/start.ts +35 -0
  105. package/templates/hello_world/src/app.tsx +41 -0
  106. package/templates/hello_world/src/index.tsx +22 -0
  107. package/templates/hello_world/styles/components.css +38 -0
  108. package/templates/hello_world/tsconfig.json +54 -0
  109. package/templates/hello_world/webpack.config.cjs +270 -0
@@ -0,0 +1,285 @@
1
+ import * as chalk from "chalk";
2
+ import * as crypto from "crypto";
3
+ import "dotenv/config";
4
+ import * as express from "express";
5
+ import * as cookieParser from "cookie-parser";
6
+ import * as basicAuth from "express-basic-auth";
7
+ import { JSONFileDatabase } from "../database/database";
8
+ import { getTokenFromQueryString } from "../../utils/backend/jwt_middleware/jwt_middleware";
9
+ import { createJwtMiddleware } from "../../utils/backend/jwt_middleware";
10
+
11
+ /**
12
+ * These are the hard-coded credentials for logging in to this template.
13
+ */
14
+ const USERNAME = "username";
15
+ const PASSWORD = "password";
16
+
17
+ const COOKIE_EXPIRY_MS = 5 * 60 * 1000; // 5 minutes
18
+
19
+ const CANVA_BASE_URL = "https://canva.com";
20
+
21
+ interface Data {
22
+ users: string[];
23
+ }
24
+
25
+ /**
26
+ * For more information on Authentication, refer to our documentation: {@link https://www.canva.dev/docs/apps/authenticating-users/#types-of-authentication}.
27
+ */
28
+ export const createAuthRouter = () => {
29
+ const APP_ID = getAppId();
30
+
31
+ /**
32
+ * Set up a database with a "users" table. In this example code, the
33
+ * database is simply a JSON file.
34
+ */
35
+ const db = new JSONFileDatabase<Data>({ users: [] });
36
+
37
+ const router = express.Router();
38
+
39
+ /**
40
+ * The `cookieParser` middleware allows the routes to read and write cookies.
41
+ *
42
+ * By passing a value into the middleware, we enable the "signed cookies" feature of Express.js. The
43
+ * value should be static and cryptographically generated. If it's dynamic (as shown below), cookies
44
+ * won't persist between server restarts.
45
+ *
46
+ * TODO: Replace `crypto.randomUUID()` with a static value, loaded via an environment variable.
47
+ */
48
+ router.use(cookieParser(crypto.randomUUID()));
49
+
50
+ /**
51
+ * This endpoint is hit at the start of the authentication flow. It contains a state which must
52
+ * be passed back to canva so that Canva can verify the response. It must also set a nonce in the
53
+ * user's browser cookies and send the nonce back to Canva as a url parameter.
54
+ *
55
+ * If Canva can validate the state, it will then redirect back to the chosen redirect url.
56
+ */
57
+ router.get("/configuration/start", async (req, res) => {
58
+ /**
59
+ * Generate a unique nonce for each request. A nonce is a random, single-use value
60
+ * that's impossible to guess or enumerate. We recommended using a Version 4 UUID that
61
+ * is cryptographically secure, such as one generated by the `randomUUID` method.
62
+ */
63
+ const nonce = crypto.randomUUID();
64
+ // Set the expiry time for the nonce. We recommend 5 minutes.
65
+ const expiry = Date.now() + COOKIE_EXPIRY_MS;
66
+
67
+ // Create a JSON string that contains the nonce and an expiry time
68
+ const nonceWithExpiry = JSON.stringify([nonce, expiry]);
69
+
70
+ // Set a cookie that contains the nonce and the expiry time
71
+ res.cookie("nonce", nonceWithExpiry, {
72
+ secure: true,
73
+ httpOnly: true,
74
+ maxAge: COOKIE_EXPIRY_MS,
75
+ signed: true,
76
+ });
77
+
78
+ // Create the query parameters that Canva requires
79
+ const params = new URLSearchParams({
80
+ nonce,
81
+ state: req?.query?.state?.toString() || "",
82
+ });
83
+
84
+ // Redirect to Canva with required parameters
85
+ res.redirect(302, `${CANVA_BASE_URL}/apps/configure/link?${params}`);
86
+ });
87
+
88
+ /**
89
+ * This endpoint renders a login page. Once the user logs in, they're
90
+ * redirected back to Canva, which completes the authentication flow.
91
+ */
92
+ router.get(
93
+ "/redirect-url",
94
+ /**
95
+ * Use a JSON Web Token (JWT) to verify incoming requests. The JWT is
96
+ * extracted from the `canva_user_token` parameter.
97
+ */
98
+ createJwtMiddleware(APP_ID, getTokenFromQueryString),
99
+ /**
100
+ * Warning: For demonstration purposes, we're using basic authentication and
101
+ * hard- coding a username and password. This is not a production-ready
102
+ * solution!
103
+ */
104
+ basicAuth({
105
+ users: { [USERNAME]: PASSWORD },
106
+ challenge: true,
107
+ }),
108
+ async (req, res) => {
109
+ const failureResponse = () => {
110
+ const params = new URLSearchParams({
111
+ success: "false",
112
+ state: req.query.state?.toString() || "",
113
+ });
114
+ res.redirect(302, `${CANVA_BASE_URL}/apps/configured?${params}`);
115
+ };
116
+
117
+ // Get the nonce and expiry time stored in the cookie.
118
+ const cookieNonceAndExpiry = req.signedCookies.nonce;
119
+
120
+ // Get the nonce from the query parameter.
121
+ const queryNonce = req.query.nonce?.toString();
122
+
123
+ // After reading the cookie, clear it. This forces abandoned auth flows to be restarted.
124
+ res.clearCookie("nonce");
125
+
126
+ let cookieNonce = "";
127
+ let expiry = 0;
128
+
129
+ try {
130
+ [cookieNonce, expiry] = JSON.parse(cookieNonceAndExpiry);
131
+ } catch {
132
+ // If the nonce can't be parsed, assume something has been compromised and exit.
133
+ return failureResponse();
134
+ }
135
+
136
+ // If the nonces are empty, exit the authentication flow.
137
+ if (
138
+ isEmpty(cookieNonceAndExpiry) ||
139
+ isEmpty(queryNonce) ||
140
+ isEmpty(cookieNonce)
141
+ ) {
142
+ return failureResponse();
143
+ }
144
+
145
+ /**
146
+ * Check that:
147
+ *
148
+ * - The nonce in the cookie and query parameter contain the same value
149
+ * - The nonce has not expired
150
+ *
151
+ * **Note:** We could rely on the cookie expiry, but that is vulnerable to tampering
152
+ * with the browser's time. This allows us to double-check based on server time.
153
+ */
154
+ if (expiry < Date.now() || cookieNonce !== queryNonce) {
155
+ return failureResponse();
156
+ }
157
+
158
+ // Get the userId from JWT middleware
159
+ const { userId } = req.canva;
160
+
161
+ // Load the database
162
+ const data = await db.read();
163
+
164
+ // Add the user to the database
165
+ if (!data.users.includes(userId)) {
166
+ data.users.push(userId);
167
+ await db.write(data);
168
+ }
169
+
170
+ // Create query parameters for redirecting back to Canva
171
+ const params = new URLSearchParams({
172
+ success: "true",
173
+ state: req?.query?.state?.toString() || "",
174
+ });
175
+
176
+ // Redirect the user back to Canva
177
+ res.redirect(302, `${CANVA_BASE_URL}/apps/configured?${params}`);
178
+ },
179
+ );
180
+
181
+ /**
182
+ * TODO: Add this middleware to all routes that will receive requests from
183
+ * your app.
184
+ */
185
+ const jwtMiddleware = createJwtMiddleware(APP_ID);
186
+
187
+ /**
188
+ * This endpoint is called when a user disconnects an app from their account.
189
+ * The app is expected to de-authenticate the user on its backend, so if the
190
+ * user reconnects the app, they'll need to re-authenticate.
191
+ *
192
+ * Note: The name of the endpoint is *not* configurable.
193
+ *
194
+ * Note: This endpoint is called by Canva's backend directly and must be
195
+ * exposed via a public URL. To test this endpoint, add a proxy URL, such as
196
+ * one generated by nGrok, to the 'Add authentication' section in the
197
+ * Developer Portal. Localhost addresses will not work to test this endpoint.
198
+ */
199
+ router.post("/configuration/delete", jwtMiddleware, async (req, res) => {
200
+ // Get the userId from JWT middleware
201
+ const { userId } = req.canva;
202
+
203
+ // Load the database
204
+ const data = await db.read();
205
+
206
+ // Remove the user from the database
207
+ await db.write({
208
+ users: data.users.filter((user) => user !== userId),
209
+ });
210
+
211
+ // Confirm that the user was removed
212
+ res.send({
213
+ type: "SUCCESS",
214
+ });
215
+ });
216
+
217
+ /**
218
+ * All routes that start with /api will be protected by JWT authentication
219
+ */
220
+ router.use("/api", jwtMiddleware);
221
+
222
+ /**
223
+ * This endpoint checks if a user is authenticated.
224
+ */
225
+ router.post("/api/authentication/status", async (req, res) => {
226
+ // Load the database
227
+ const data = await db.read();
228
+
229
+ // Check if the user is authenticated
230
+ const isAuthenticated = data.users.includes(req.canva.userId);
231
+
232
+ // Return the authentication status
233
+ res.send({
234
+ isAuthenticated,
235
+ });
236
+ });
237
+
238
+ return router;
239
+ };
240
+
241
+ /**
242
+ * Checks if a given param is nullish or an empty string
243
+ *
244
+ * @param str The string to check
245
+ * @returns true if the string is nullish or empty, false otherwise
246
+ */
247
+ function isEmpty(str?: string): boolean {
248
+ return str == null || str.length === 0;
249
+ }
250
+
251
+ /**
252
+ * Retrieves the CANVA_APP_ID from the environment variables.
253
+ * Throws an error if the CANVA_APP_ID environment variable is undefined or set to a default value.
254
+ *
255
+ * @returns {string} The Canva App ID
256
+ * @throws {Error} If CANVA_APP_ID environment variable is undefined or set to a default value
257
+ */
258
+ function getAppId(): string {
259
+ // TODO: Set the CANVA_APP_ID environment variable in the project's .env file
260
+ const appId = process.env.CANVA_APP_ID;
261
+
262
+ if (!appId) {
263
+ throw new Error(
264
+ `The CANVA_APP_ID environment variable is undefined. Set the variable in the project's .env file.`,
265
+ );
266
+ }
267
+
268
+ if (appId === "YOUR_APP_ID_HERE") {
269
+ // eslint-disable-next-line no-console
270
+ console.log(
271
+ chalk.bgRedBright(
272
+ "Default 'CANVA_APP_ID' environment variable detected.",
273
+ ),
274
+ );
275
+ // eslint-disable-next-line no-console
276
+ console.log(
277
+ "Please update the 'CANVA_APP_ID' environment variable in your project's `.env` file " +
278
+ `with the App ID obtained from the Canva Developer Portal: ${chalk.greenBright(
279
+ "https://www.canva.com/developers/apps",
280
+ )}\n`,
281
+ );
282
+ }
283
+
284
+ return appId;
285
+ }
@@ -0,0 +1,86 @@
1
+ import * as express from "express";
2
+ import * as crypto from "crypto";
3
+ import type {
4
+ Container,
5
+ FindResourcesRequest,
6
+ Resource,
7
+ } from "@canva/app-components";
8
+
9
+ /**
10
+ * Generates a unique hash for a url.
11
+ * Handy for uniquely identifying an image and creating an image id
12
+ */
13
+ export async function generateHash(message: string) {
14
+ const msgUint8 = new TextEncoder().encode(message);
15
+ const hashBuffer = await crypto.subtle.digest("SHA-256", msgUint8);
16
+ const hashArray = Array.from(new Uint8Array(hashBuffer));
17
+ const hashHex = hashArray
18
+ .map((b) => b.toString(16).padStart(2, "0"))
19
+ .join("");
20
+ return hashHex;
21
+ }
22
+
23
+ const imageUrls = [
24
+ "https://cdn.pixabay.com/photo/2023/09/16/18/26/hummingbird-8257355_1280.jpg",
25
+ "https://cdn.pixabay.com/photo/2023/12/10/03/00/peacock-8440548_1280.jpg",
26
+ "https://cdn.pixabay.com/photo/2023/12/20/07/04/mountains-8459056_1280.jpg",
27
+ "https://cdn.pixabay.com/photo/2023/11/26/07/29/sparrow-8413000_1280.jpg",
28
+ "https://cdn.pixabay.com/photo/2023/12/12/16/11/mountain-8445543_1280.jpg",
29
+ ];
30
+
31
+ export const createDamRouter = () => {
32
+ const router = express.Router();
33
+
34
+ /**
35
+ * This endpoint returns the data for your app.
36
+ *
37
+ * TODO: you must change this path to `/api/resources/find` before
38
+ * submitting to ensure a user is authenticated
39
+ */
40
+ router.post("/resources/find", async (req, res) => {
41
+ // You should modify these lines to return data from your
42
+ // digital asset manager (DAM) based on the findResourcesRequest
43
+ const findResourcesRequest: FindResourcesRequest = req.body;
44
+ const { types } = findResourcesRequest;
45
+
46
+ let resources: Resource[] = [];
47
+ if (types.includes("IMAGE")) {
48
+ resources = await Promise.all(
49
+ Array.from({ length: 40 }, async (_, i) => ({
50
+ id: await generateHash(imageUrls[i % imageUrls.length]),
51
+ mimeType: "image/jpeg",
52
+ name: "My new thing",
53
+ type: "IMAGE",
54
+ thumbnail: {
55
+ url: imageUrls[i % imageUrls.length],
56
+ },
57
+ url: imageUrls[i % imageUrls.length],
58
+ })),
59
+ );
60
+ }
61
+
62
+ if (types.includes("CONTAINER")) {
63
+ const containers = await Promise.all(
64
+ Array.from(
65
+ { length: 10 },
66
+ async (_, i) =>
67
+ ({
68
+ id: await generateHash(i + ""),
69
+ containerType: "folder",
70
+ name: `My folder ${i}`,
71
+ type: "CONTAINER",
72
+ }) satisfies Container,
73
+ ),
74
+ );
75
+
76
+ resources = resources.concat(containers);
77
+ }
78
+
79
+ res.send({
80
+ resources,
81
+ continuation: +(findResourcesRequest.continuation || 0) + 1,
82
+ });
83
+ });
84
+
85
+ return router;
86
+ };
@@ -0,0 +1,65 @@
1
+ import * as express from "express";
2
+ import * as cors from "cors";
3
+ import { createBaseServer } from "../utils/backend/base_backend/create";
4
+ import { createDamRouter } from "./routers/dam";
5
+ import { createAuthRouter } from "./routers/auth";
6
+
7
+ async function main() {
8
+ // TODO: Set the CANVA_APP_ID environment variable in the project's .env file
9
+ const APP_ID = process.env.CANVA_APP_ID;
10
+
11
+ if (!APP_ID) {
12
+ throw new Error(
13
+ `The CANVA_APP_ID environment variable is undefined. Set the variable in the project's .env file.`,
14
+ );
15
+ }
16
+
17
+ const router = express.Router();
18
+
19
+ /**
20
+ * TODO: Configure your CORS Policy
21
+ *
22
+ * Cross-Origin Resource Sharing
23
+ * ([CORS](https://developer.mozilla.org/en-US/docs/Glossary/CORS)) is an
24
+ * [HTTP](https://developer.mozilla.org/en-US/docs/Glossary/HTTP)-header based
25
+ * mechanism that allows a server to indicate any
26
+ * [origins](https://developer.mozilla.org/en-US/docs/Glossary/Origin)
27
+ * (domain, scheme, or port) other than its own from which a browser should
28
+ * permit loading resources.
29
+ *
30
+ * A basic CORS configuration would include the origin of your app in the
31
+ * following example:
32
+ * const corsOptions = {
33
+ * origin: 'https://app-abcdefg.canva-apps.com',
34
+ * optionsSuccessStatus: 200
35
+ * }
36
+ *
37
+ * The origin of your app is https://app-${APP_ID}.canva-apps.com, and note
38
+ * that the APP_ID should to be converted to lowercase.
39
+ *
40
+ * https://www.npmjs.com/package/cors#configuring-cors
41
+ *
42
+ * You may need to include multiple permissible origins, or dynamic origins
43
+ * based on the environment in which the server is running. Further
44
+ * information can be found
45
+ * [here](https://www.npmjs.com/package/cors#configuring-cors-w-dynamic-origin).
46
+ */
47
+ router.use(cors());
48
+
49
+ /**
50
+ * Add routes for authorisation.
51
+ */
52
+ const authRouter = createAuthRouter();
53
+ router.use(authRouter);
54
+
55
+ /**
56
+ * Add routes for digital asset management.
57
+ */
58
+ const damRouter = createDamRouter();
59
+ router.use(damRouter);
60
+
61
+ const server = createBaseServer(router);
62
+ server.start(process.env.CANVA_BACKEND_PORT);
63
+ }
64
+
65
+ main();
@@ -0,0 +1,29 @@
1
+ declare module "*.css" {
2
+ const styles: { [className: string]: string };
3
+ export = styles;
4
+ }
5
+
6
+ declare module "*.jpg" {
7
+ const content: string;
8
+ export default content;
9
+ }
10
+
11
+ declare module "*.jpeg" {
12
+ const content: string;
13
+ export default content;
14
+ }
15
+
16
+ declare module "*.png" {
17
+ const content: string;
18
+ export default content;
19
+ }
20
+
21
+ declare module "*.svg" {
22
+ const content: React.FunctionComponent<{
23
+ size?: "tiny" | "small" | "medium" | "large";
24
+ className?: string;
25
+ }>;
26
+ export default content;
27
+ }
28
+
29
+ declare const BACKEND_HOST: string;