def METHOD_NAME() -> None:
    prop = TypeScriptProperty(required=True, key="myKey", value=TypeScriptPrimitive("string"))
    assert prop.write() == "myKey: string;"
    prop.required = False
    assert prop.write() == "myKey?: string;"