Noir
  • πŸšΆβ€β™‚οΈIntro
  • πŸ“Tutorials
    • πŸŽ“Starting Noir
    • πŸ“–Libraries
    • πŸ–₯️Services
    • ❔Libraries VS Services
    • πŸ’¬Callbacks
    • πŸ’₯Classes
    • πŸ”ŽDebugging
  • πŸ“šExamples
  • β˜„οΈAPI Reference
    • Bootstrapper
    • Built-Ins
      • Classes
        • AITarget
        • Body
        • Command
        • Connection
        • Event
        • HTTPRequest
        • HTTPResponse
        • Library
        • Message
        • Object
        • Player
        • Service
        • Task
        • TickIterationProcess
        • Tracker
        • Vehicle
        • Widgets
          • MapLabelWidget
          • MapLineWidget
          • MapObjectWidget
          • PopupWidget
          • ScreenPopupWidget
          • Widget
      • Libraries
        • Base64
        • Dataclasses
        • Deprecation
        • Events
        • HTTP
        • JSON
        • Logging
        • Matrix
        • Number
        • String
        • Table
      • Services
        • CommandService
        • GameSettingsService
        • HTTPService
        • MessageService
        • NotificationService
        • ObjectService
        • PlayerService
        • TaskService
        • TPSService
        • UIService
        • VehicleService
    • Callbacks
    • Class
    • Classes
    • Debugging
    • Definition
    • Libraries
    • Noir
    • Services
    • TypeChecking
Powered by GitBook
On this page
  • Parameters
  • Parameters
  • Parameters
  • Returns
Edit on GitHub
  1. API Reference

TypeChecking

Noir.TypeChecking: table

A module of Noir for checking if a value is of the correct type.

This normally would be a library, but libraries need to use this and libraries are meant to be independent of each other.


Noir.TypeChecking._DummyClass: NoirClass

A dummy class for checking if a value is a class or not.

Used internally.


Noir.TypeChecking:Assert(origin, parameterName, value, ...)

Raises an error if the value is not any of the provided types.

This supports checking if a value is a specific class or not too.

Parameters

  • origin: string - The location of the thing (method, function, etc) that called this so the user can find out where something went wrong

  • parameterName: string - The name of the parameter that is being type checked

  • value: any

  • ...: NoirTypeCheckingType


Noir.TypeChecking:AssertMany(origin, parameterName, values, ...)

Raises an error if any of the provided values are not any of the provided types.

Parameters

  • origin: string - The location of the thing (method, function, etc) that called this so the user can find out where something went wrong

  • parameterName: string - The name of the parameter that is being type checked

  • values: table<integer, any>

  • ...: NoirTypeCheckingType


Noir.TypeChecking:_FormatTypes(types)

Format required types for an error message.

Used internally.

Parameters

  • types: table<integer, NoirTypeCheckingType>

Returns

  • string

PreviousServices

Last updated 2 months ago

β˜„οΈ