Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API definitions file. #217

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
201 changes: 69 additions & 132 deletions Scripts/DCS-BIOS/lib/DCS_API.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---@meta

---@class lfs
--- @class lfs
--- DCS Local File System
lfs = {}

---@return string Returns the root location of DCS location in user folder
--- @return string Returns the root location of DCS location in user folder
function lfs.writedir()
return "";
end
Expand All @@ -17,32 +17,25 @@ CockpitDevice = {}
--- @func Sets command for a device
--- @param command_id integer
--- @param value integer
function CockpitDevice:SetCommand(command_id, value)
end
function CockpitDevice:SetCommand(command_id, value) end

--- @func Sets a device's argument?
--- @param argument_id integer
--- @param value integer
function CockpitDevice:set_argument_value(argument_id, value)
end
function CockpitDevice:set_argument_value(argument_id, value) end

--- @func Sets a device's frequency
--- @param frequency number
function CockpitDevice:set_frequency(frequency)
end
function CockpitDevice:set_frequency(frequency) end

--- @func Gets a device's frequency
--- @return number
function CockpitDevice:get_frequency()
return 0
end
function CockpitDevice:get_frequency() end

--- @func Gets a device based on the device ID as specified in devices.lua
--- @param argument_id integer
--- @return number The current value of the CockpitDevice
function CockpitDevice:get_argument_value(argument_id)
return 0;
end
function CockpitDevice:get_argument_value(argument_id) end

--- @func Makes the device perform an action
--- @param command_id integer
Expand All @@ -55,251 +48,195 @@ end
--- @func Gets a device based on the device ID as specified in devices.lua
--- @param device_id integer
--- @return CockpitDevice
function GetDevice(device_id)
return CockpitDevice;
end
function GetDevice(device_id) end

--- @func Gets the draw value for a certain animation
--- @param draw_argument_id integer
--- @return number
function LoGetAircraftDrawArgumentValue(draw_argument_id)
return 0;
end
function LoGetAircraftDrawArgumentValue(draw_argument_id) end



--- Contains Postions and Altitude
--- @class LatLongAlt
--- Contains Postions Information and Altitude
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field Lat number
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field Long number
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field Alt number Altitude in meters
LatLongAlt = {
Lat = 0,
Long = 0,
Alt = 0
}
LatLongAlt = {}

--- @class AicraftData
--- Contains Aircraft Data
--- @class AicraftData
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field Name string
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field Heading number
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field LatLongAlt LatLongAlt
AicraftData = {
Name = "",
Heading = 0,
LatLongAlt
}
AicraftData = {}

--- @func Returns SelfData that holds information about the aircraft
--- @return AicraftData
function LoGetSelfData()
return AicraftData;
end
function LoGetSelfData() end

--- @func Returns the simulation time
--- @return number
function LoGetModelTime()
return 0;
end
function LoGetModelTime() end


--- @func Returns the mission start time
--- @return number
function LoGetMissionStartTime()
return 0;
end
function LoGetMissionStartTime() end

--- @func Returns whether own ships/aircraft data can be exported.
--- @return boolean
function LoIsOwnshipExportAllowed()
return true;
end
function LoIsOwnshipExportAllowed() end

--- @func Returns pilot's name
--- @return string
function LoGetPilotName()
return "";
end
function LoGetPilotName() end

--- @func Returns indicated airspeed
--- @return number
function LoGetIndicatedAirSpeed()
return 0;
end
function LoGetIndicatedAirSpeed() end

--- @class AccelerationUnit
--- Contains acceleration info for all dimensions
--- @class AccelerationUnit
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field x number
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field y number
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field z number
AccelerationUnit = {
x = 0,
y = 0,
z = 0
}
AccelerationUnit = {}

--- @func Returns G Load
--- @return AccelerationUnit
function LoGetAccelerationUnits()
return AccelerationUnit;
end
function LoGetAccelerationUnits() end

--- @func Returns ADI pitch, band, yaw
--- @return number
--- @return number
function LoGetADIPitchBankYaw()
return unpack({0, 0, 0});
end

--- @class CounterMeasures
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field chaff number
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field flare number
CounterMeasures = {
chaff = 0,
flare = 0
}
CounterMeasures = {}

--- @func Returns information about countermeasures
--- @return CounterMeasures
function LoGetSnares()
return CounterMeasures;
end
function LoGetSnares() end

--- @func Returns a list of strings for a cockpit indicator (screen)
--- @return string
function list_indication(indicator_id)
return "";
end
function list_indication(indicator_id) end

--- @class CockpitPage
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field sub string
CockpitPage = {}

--- @func Searches for matches in CockpitPage
--- @param search_value string
--- @return CockpitPage
function CockpitPage:match(search_value)
return CockpitPage;
end
function CockpitPage:match(search_value) end

--- @func sub? CockpitPage
--- @param index integer
--- @return string
function CockpitPage:sub(index)
return "";
end
function CockpitPage:sub(index) end

--- @func Returns a list of pages (cockpit screens)
--- @return CockpitPage
function list_cockpit_params()
return CockpitPage;
end
function list_cockpit_params() end

--- @func Returns something and does something
--- @func Maps value to from input_range to output_range
--- @param argument_value number
--- @param input_range table
--- @param output_range table
--- @return number
function ValueConvert(argument_value, input_range, output_range)
end
function ValueConvert(argument_value, input_range, output_range) end

--- @func Returns altitude above sea level
--- @return number
function LoGetAltitudeAboveSeaLevel()
return 0;
end
function LoGetAltitudeAboveSeaLevel() end

--- @func Returns altitude above ground level
--- @return number
function LoGetAltitudeAboveGroundLevel()
return 0;
end
function LoGetAltitudeAboveGroundLevel() end

--- @func Returns vertical velocity
--- @return number
function LoGetVerticalVelocity()
return 0;
end
function LoGetVerticalVelocity() end

--- @func Returns true air speed
--- @return number
function LoGetTrueAirSpeed()
return 0;
end
function LoGetTrueAirSpeed() end

--- @func Returns mach number
--- @return number
function LoGetMachNumber()
return 0;
end
function LoGetMachNumber() end

--- @func Returns angle of attack
--- @return number
function LoGetAngleOfAttack()
return 0;
end
function LoGetAngleOfAttack() end

--- @func Returns glide deviation
--- @return number
function LoGetGlideDeviation()
return 0;
end
function LoGetGlideDeviation() end

--- @func Returns side deviation
--- @return number
function LoGetSideDeviation()
return 0;
end
function LoGetSideDeviation() end

--- @func Returns slip ball position
--- @return number
function LoGetSlipBallPosition()
return 0;
end
function LoGetSlipBallPosition() end


--- @class EngineSide
--- @field right number
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field right number
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field left number
EngineSide = {
right = 0,
left = 0
}
EngineSide = {}

--- @class EngineInformation
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field RPM EngineSide
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field Temperature EngineSide
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field HydraulicPressure EngineSide
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field FuelConsumption EngineSide
EngineInformation = {
RPM = EngineSide,
Temperature = EngineSide,
HydraulicPressure = EngineSide,
FuelConsumption = EngineSide
}
EngineInformation = {}

--- @func Returns engine information
--- @return EngineInformation
function LoGetEngineInfo()
return EngineInformation;
end
function LoGetEngineInfo() end

--- @class GearValue
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field right number
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field left number
GearValue = {
value = 0
}
GearValue = {}

--- @class MechanicalInformation
--- @diagnostic disable-next-line: duplicate-doc-field
--- @field gear GearValue
MechanicalInformation = {
gear = GearValue
}
MechanicalInformation = {}

--- @func Returns mechanical information
--- @return MechanicalInformation
function LoGetMechInfo()
return MechanicalInformation;
end
function LoGetMechInfo() end