// Here we have some examples. All work, usually only one is necessary.
import 'discord.js'
import * as Discord from 'discord.js'
import {Client} from 'discord.js'
// module.ts
export const name = 'name'
function fnExample() {
console.log('Example')
}
export default {
fnExample
}
// Import module.ts
import modName, { name } from './module.ts'
modName.fnExample()
Starting with ECMAScript 2015, JavaScript has a concept of modules.
TypeScript shares this concept.
Modules are executed within their own scope,
not in the global scope; this means that variables, functions, classes, etc.
declared in a module are not visible outside the module unless
they are explicitly exported using one of the export forms.
Conversely, to consume a variable, function, class, interface, etc. exported from a
different module, it has to be imported using one of the import forms.