I would like to create and import a class in GDScript. Here is some non-functional pseudo code to explain what I'm trying to do:
```
class_name WordPrinter
var my_word: String
func _init(word: String)
my_word = word
func print_word()
print(my_word)
```
```
const word_printer = import("./word_printer.gd").new("Hello World")
word_printer.print_word()
```
I've found various tutorials on classes and imports, but I have yet to find a straightforward code example that works. Here are some places I've looked:
- https://www.javatpoint.com/godot-classes-in-gdscript
- https://coderwall.com/p/anrtcg/how-to-import-script-in-godot
- https://godottutorials.com/courses/introduction-to-gdscript/godot-tutorials-gdscript-15/
- https://gdscript.com/tutorials/classes/
The second link above does show working code, but the imported class does not have any type definitions, and is not very useful.