Skip to content

Commit

Permalink
TypeStronggh-1556 example: variables
Browse files Browse the repository at this point in the history
  • Loading branch information
srmagura committed Oct 2, 2021
1 parent 3a4b60b commit 8f26698
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions example/src/index.ts
@@ -1,3 +1,4 @@
// Don't reorder!
export * from "./functions";
export * from "./variables";
export * from "./enums";
22 changes: 22 additions & 0 deletions example/src/variables.ts
@@ -0,0 +1,22 @@
/** A simple numeric constant. */
export const PI = 3.14159265359;

/** A simple string constant. */
export const STRING_CONSTANT = "FOOBAR";

/** An plain JavaScript object using `as const`. */
export const ObjectConstant = {
library: "typedoc",
version: "1.2.3",

/** How many people starred us on GitHub. */
githubStars: 1_000_000,
} as const;

/**
* An exported variable defined with `let`.
*
* This pattern should generally be avoided because the variable can be reassigned.
*/
// eslint-disable-next-line prefer-const
export let E = 2.718281828459045235;

0 comments on commit 8f26698

Please sign in to comment.