Editor

Namespace: editor Language: Lua Type: Defold Lua

Editor scripting documentation

API

editor.bob

Type: FUNCTION Run bob the builder program For the full documentation of the available commands and options, see the bob manual.

Parameters

Examples

Print help in the console:

editor.bob({help = true})

Bundle the game for the host platform:

local opts = {
    archive = true,
    platform = editor.platform
}
editor.bob(opts, "distclean", "resolve", "build", "bundle")

Using snake_cased and repeated options:

local opts = {
    archive = true,
    platform = editor.platform,
    build_server = "https://build.my-company.com",
    settings = {"test.ini", "headless.ini"}
}
editor.bob(opts, "distclean", "resolve", "build")

editor.browse

Type: FUNCTION Open a URL in the default browser or a registered application

Parameters

editor.can_add

Type: FUNCTION Check whether this list property supports add, clear, and remove operations on the supplied node.

Parameters

Returns

editor.can_get

Type: FUNCTION Check whether this property is exposed for reading on the supplied node or resource.

Parameters

Returns

editor.can_reorder

Type: FUNCTION Check whether this list property supports reordering on the supplied node.

Parameters

Returns

editor.can_reset

Type: FUNCTION Check whether this property supports reset on the supplied node.

Parameters

Returns

editor.can_set

Type: FUNCTION Check whether this property is exposed for setting on the supplied node.

Parameters

Returns

editor.command

Type: TYPEDEF An editor command

Parameters

editor.command

Type: FUNCTION Create an editor command

Parameters

Returns

Examples

Print Git history for a file:

editor.command({
  label = "Git History",
  query = {
    selection = {
      type = "resource",
      cardinality = "one"
    }
  },
  run = function(opts)
    editor.execute(
      "git",
      "log",
      "--follow",
      "." .. editor.get(opts.selection, "path"),
      {reload_resources=false})
  end
})

editor.command.context

Type: STRUCT Context provided to editor command handler functions

Members

editor.command.location

Type: TYPEDEF A location where an editor command can be displayed

Parameters

editor.command.options

Type: STRUCT Options used to create an editor command

Members

editor.command.query

Type: STRUCT A query that controls command availability and provides context to its handler functions

Members

editor.command.query.active_view

Type: STRUCT Active editor view requested by an editor command

Members

editor.command.query.selection

Type: STRUCT Selection requested by an editor command

Members

editor.component

Type: TYPEDEF Editor UI component

Parameters

editor.create_directory

Type: FUNCTION Create a directory if it does not exist, and all non-existent parent directories. Throws an error if the directory can’t be created.

Parameters

Examples

editor.create_directory("/assets/gen")

editor.create_resources

Type: FUNCTION Create resources (including non-existent parent directories). Throws an error if any of the provided resource paths already exist

Parameters

Examples

Create a single resource from template:

editor.create_resources({
  "/npc.go"
})

Create multiple resources:

editor.create_resources({
  "/npc.go",
  "/levels/1.collection",
  "/levels/2.collection",
})

Create a resource with custom content:

editor.create_resources({
  {"/npc.script", "go.property('hp', 100)"}
})

editor.create_resources.resource

Type: TYPEDEF A resource definition used by editor.create_resources

Parameters

editor.delete_directory

Type: FUNCTION Delete a directory if it exists, and all existent child directories and files. Throws an error if the directory can’t be deleted.

Parameters

Examples

editor.delete_directory("/assets/gen")

editor.editor_sha1

Type: VARIABLE A string, SHA1 of Defold editor

editor.engine_sha1

Type: VARIABLE A string, SHA1 of Defold engine

editor.execute

Type: FUNCTION Execute a shell command. Any shell command arguments should be provided as separate argument strings to this function. If the exit code of the process is not zero, this function throws error. By default, the function returns nil, but it can be configured to capture the output of the shell command as string and return it — set out option to “capture” to do it.By default, after this shell command is executed, the editor will reload resources from disk.

Parameters

Returns

Examples

Make a directory with spaces in it:

editor.execute("mkdir", "new dir")

Read the git status:

local status = editor.execute("git", "status", "--porcelain", {
  reload_resources = false,
  out = "capture"
})

editor.execute.options

Type: STRUCT Options for editor.execute

Members

editor.external_file_attributes

Type: FUNCTION Query information about file system path

Parameters

Returns

editor.external_file_attributes.result

Type: STRUCT External file attributes

Members

editor.fetch_libraries

Type: FUNCTION Download the latest version of the project library dependencies and reload library-provided editor scripts. This function may replace library-provided editor commands, hooks, routes, and UI contributed by editor scripts, so it should typically be the last operation performed by a command.

editor.get

Type: FUNCTION Get a value of a node property inside the editor. Some properties might be read-only, and some might be unavailable in different contexts, so you should use editor.can_get() before reading them and editor.can_set() before making the editor set them.

Parameters

Returns

editor.image

Type: TYPEDEF Image loaded for reading by an editor script

Parameters

editor.message

Type: TYPEDEF Localizable editor message

Parameters

editor.open_external_file

Type: FUNCTION Open a file in a registered application

Parameters

editor.platform

Type: VARIABLE Editor platform id. A string, either:

editor.prefs.get

Type: FUNCTION Get preference value The schema for the preference value should be defined beforehand.

Parameters

Returns

editor.prefs.is_set

Type: FUNCTION Check if preference value is explicitly set The schema for the preference value should be defined beforehand.

Parameters

Returns

editor.prefs.schema.array

Type: FUNCTION array schema

Parameters

Returns

editor.prefs.schema.array.options

Type: STRUCT Options for editor.prefs.schema.array

Members

editor.prefs.schema.boolean

Type: FUNCTION boolean schema

Parameters

Returns

editor.prefs.schema.boolean.options

Type: STRUCT Options for editor.prefs.schema.boolean

Members

editor.prefs.schema.enum

Type: FUNCTION enum value schema

Parameters

Returns

editor.prefs.schema.enum.options

Type: STRUCT Options for editor.prefs.schema.enum

Members

editor.prefs.schema.integer

Type: FUNCTION integer schema

Parameters

Returns

editor.prefs.schema.integer.options

Type: STRUCT Options for editor.prefs.schema.integer

Members

editor.prefs.schema.keyword

Type: FUNCTION keyword schema A keyword is a short string that is interned within the editor runtime, useful e.g. for identifiers

Parameters

Returns

editor.prefs.schema.keyword.options

Type: STRUCT Options for editor.prefs.schema.keyword

Members

editor.prefs.schema.number

Type: FUNCTION floating-point number schema

Parameters

Returns

editor.prefs.schema.number.options

Type: STRUCT Options for editor.prefs.schema.number

Members

editor.prefs.schema.object

Type: FUNCTION heterogeneous object schema

Parameters

Returns

editor.prefs.schema.object.options

Type: STRUCT Options for editor.prefs.schema.object

Members

editor.prefs.schema.object_of

Type: FUNCTION homogeneous object schema

Parameters

Returns

editor.prefs.schema.object_of.options

Type: STRUCT Options for editor.prefs.schema.object_of

Members

editor.prefs.schema.one_of

Type: FUNCTION one of schema

Parameters

Returns

editor.prefs.schema.one_of.options

Type: STRUCT Options for editor.prefs.schema.one_of

Members

editor.prefs.schema.password

Type: FUNCTION password schema A password is a string that is encrypted when stored in a preference file

Parameters

Returns

editor.prefs.schema.password.options

Type: STRUCT Options for editor.prefs.schema.password

Members

editor.prefs.schema.set

Type: FUNCTION set schema Set is represented as a lua table with true values

Parameters

Returns

editor.prefs.schema.set.options

Type: STRUCT Options for editor.prefs.schema.set

Members

editor.prefs.schema.string

Type: FUNCTION string schema

Parameters

Returns

editor.prefs.schema.string.options

Type: STRUCT Options for editor.prefs.schema.string

Members

editor.prefs.schema.tuple

Type: FUNCTION tuple schema A tuple is a fixed-length array where each item has its own defined type

Parameters

Returns

editor.prefs.schema.tuple.options

Type: STRUCT Options for editor.prefs.schema.tuple

Members

editor.prefs.SCOPE

Type: ENUM Constants for scope enums

Parameters

Members

editor.prefs.set

Type: FUNCTION Set preference value The schema for the preference value should be defined beforehand.

Parameters

editor.properties

Type: FUNCTION List property names for a node. The result is context-sensitive and can vary by node/resource type and editor state. Returned names are readable with editor.get(node, property). Mutating capabilities are per-property; use editor.can_set(), editor.can_reset(), editor.can_add(), and editor.can_reorder() to check which operations are supported.

Parameters

Returns

editor.resource_attributes

Type: FUNCTION Query information about a project resource

Parameters

Returns

editor.resource_attributes.result

Type: STRUCT Project resource attributes

Members

editor.save

Type: FUNCTION Persist any unsaved changes to disk

editor.schema

Type: TYPEDEF Editor preference schema

Parameters

editor.tiles

Type: TYPEDEF Unbounded two-dimensional grid of tiles

Parameters

editor.transact

Type: FUNCTION Change the editor state in a single, undoable transaction

Parameters

editor.transaction_step

Type: TYPEDEF Editor transaction step

Parameters

editor.tx.add

Type: FUNCTION Create a transaction step that will add a child item to a node’s list property when transacted with editor.transact().

Parameters

Returns

editor.tx.clear

Type: FUNCTION Create a transaction step that will remove all items from node’s list property when transacted with editor.transact().

Parameters

Returns

editor.tx.remove

Type: FUNCTION Create a transaction step that will remove a child node from the node’s list property when transacted with editor.transact().

Parameters

Returns

editor.tx.reorder

Type: FUNCTION Create a transaction step that reorders child nodes in a node list defined by the property if supported (see editor.can_reorder())

Parameters

Returns

editor.tx.reset

Type: FUNCTION Create a transaction step that will reset an overridden property to its default value when transacted with editor.transact().

Parameters

Returns

editor.tx.set

Type: FUNCTION Create transaction step that will set the node’s property to a supplied value when transacted with editor.transact().

Parameters

Returns

editor.ui.ALIGNMENT

Type: ENUM Constants for alignment enums

Parameters

Members

editor.ui.button

Type: FUNCTION Button with a label and/or an icon

Parameters

Returns

editor.ui.button.props

Type: STRUCT Properties for editor.ui.button

Members

editor.ui.check_box

Type: FUNCTION Check box with a label

Parameters

Returns

editor.ui.check_box.props

Type: STRUCT Properties for editor.ui.check_box

Members

editor.ui.COLOR

Type: ENUM Constants for color enums

Parameters

Members

editor.ui.component

Type: FUNCTION Convert a function to a UI component. The wrapped function may call any hooks functions (editor.ui.use_*), but on any function invocation, the hooks calls must be the same, and in the same order. This means that hooks should not be used inside loops and conditions or after a conditional return statement. The grow, row_span, and column_span props are supported automatically.

Parameters

Returns

editor.ui.dialog

Type: FUNCTION Dialog component, a top-level window component that can’t be used as a child of other components

Parameters

Returns

editor.ui.dialog.props

Type: STRUCT Properties for editor.ui.dialog

Members

editor.ui.dialog_button

Type: FUNCTION Dialog button shown in the footer of a dialog

Parameters

Returns

editor.ui.dialog_button.props

Type: STRUCT Properties for editor.ui.dialog_button

Members

editor.ui.external_file_field

Type: FUNCTION Input component for selecting files from the file system

Parameters

Returns

editor.ui.external_file_field.props

Type: STRUCT Properties for editor.ui.external_file_field

Members

editor.ui.external_file_filter

Type: STRUCT External file dialog filter

Members

editor.ui.grid

Type: FUNCTION Layout container that places its children in a 2D grid

Parameters

Returns

editor.ui.grid.constraint

Type: STRUCT Grid row or column constraint

Members

editor.ui.grid.props

Type: STRUCT Properties for editor.ui.grid

Members

editor.ui.heading

Type: FUNCTION A text heading

Parameters

Returns

editor.ui.heading.props

Type: STRUCT Properties for editor.ui.heading

Members

editor.ui.HEADING_STYLE

Type: ENUM Constants for heading style enums

Parameters

Members

editor.ui.horizontal

Type: FUNCTION Layout container that places its children in a horizontal row one after another

Parameters

Returns

editor.ui.horizontal.props

Type: STRUCT Properties for editor.ui.horizontal

Members

editor.ui.ICON

Type: ENUM Constants for icon enums

Parameters

Members

editor.ui.icon

Type: FUNCTION An icon from a predefined set

Parameters

Returns

editor.ui.icon.props

Type: STRUCT Properties for editor.ui.icon

Members

editor.ui.image

Type: FUNCTION An image

Parameters

Returns

editor.ui.image.props

Type: STRUCT Properties for editor.ui.image

Members

editor.ui.integer_field

Type: FUNCTION Integer input component based on a text field, reports changes on commit (Enter or focus loss)

Parameters

Returns

editor.ui.integer_field.props

Type: STRUCT Properties for editor.ui.integer_field

Members

editor.ui.issue

Type: STRUCT Issue associated with an input component

Members

editor.ui.ISSUE_SEVERITY

Type: ENUM Constants for issue severity enums

Parameters

Members

editor.ui.label

Type: FUNCTION Label intended for use with input components

Parameters

Returns

editor.ui.label.props

Type: STRUCT Properties for editor.ui.label

Members

editor.ui.number_field

Type: FUNCTION Number input component based on a text field, reports changes on commit (Enter or focus loss)

Parameters

Returns

editor.ui.number_field.props

Type: STRUCT Properties for editor.ui.number_field

Members

editor.ui.open_resource

Type: FUNCTION Open a resource using its primary or selected view, either in the editor or in a third-party app. Code and Text views accept a one-based cursor or range in args: {line = 42}, {line = 42, column = 12}, or {from = {line = 42, column = 12}, to = {line = 43, column = 4}}

Parameters

editor.ui.ORIENTATION

Type: ENUM Constants for orientation enums

Parameters

Members

editor.ui.PADDING

Type: ENUM Constants for padding enums

Parameters

Members

editor.ui.paragraph

Type: FUNCTION A paragraph of text

Parameters

Returns

editor.ui.paragraph.props

Type: STRUCT Properties for editor.ui.paragraph

Members

editor.ui.resource_field

Type: FUNCTION Input component for selecting project resources

Parameters

Returns

editor.ui.resource_field.props

Type: STRUCT Properties for editor.ui.resource_field

Members

editor.ui.scroll

Type: FUNCTION Layout container that optionally shows scroll bars if child contents overflow the assigned bounds

Parameters

Returns

editor.ui.scroll.props

Type: STRUCT Properties for editor.ui.scroll

Members

editor.ui.select_box

Type: FUNCTION Dropdown select box with an array of options

Parameters

Returns

editor.ui.select_box.props

Type: STRUCT Properties for editor.ui.select_box

Members

editor.ui.separator

Type: FUNCTION Thin line for visual content separation, by default horizontal and aligned to center

Parameters

Returns

editor.ui.separator.props

Type: STRUCT Properties for editor.ui.separator

Members

editor.ui.show_dialog

Type: FUNCTION Show a dialog and await a result

Parameters

Returns

editor.ui.show_external_directory_dialog

Type: FUNCTION Show a modal OS directory selection dialog and await a result

Parameters

Returns

editor.ui.show_external_directory_dialog.options

Type: STRUCT Options for editor.ui.show_external_directory_dialog

Members

editor.ui.show_external_file_dialog

Type: FUNCTION Show a modal OS file selection dialog and await a result

Parameters

Returns

editor.ui.show_external_file_dialog.options

Type: STRUCT Options for editor.ui.show_external_file_dialog

Members

editor.ui.show_resource_dialog

Type: FUNCTION Show a modal resource selection dialog and await a result

Parameters

Returns

editor.ui.show_resource_dialog.options

Type: STRUCT Options for editor.ui.show_resource_dialog

Members

editor.ui.SPACING

Type: ENUM Constants for spacing enums

Parameters

Members

editor.ui.string_field

Type: FUNCTION String input component based on a text field, reports changes on commit (Enter or focus loss)

Parameters

Returns

editor.ui.string_field.props

Type: STRUCT Properties for editor.ui.string_field

Members

editor.ui.tab

Type: FUNCTION Tab used in the tabs prop of editor.ui.tabs(…)

Parameters

Returns

editor.ui.tab.props

Type: STRUCT Properties for editor.ui.tab

Members

editor.ui.tabs

Type: FUNCTION Layout container that shows one selected tab content at a time

Parameters

Returns

editor.ui.tabs.props

Type: STRUCT Properties for editor.ui.tabs

Members

editor.ui.TEXT_ALIGNMENT

Type: ENUM Constants for text alignment enums

Parameters

Members

editor.ui.use_memo

Type: FUNCTION A hook that caches the result of a computation between re-renders. See editor.ui.component for hooks caveats and rules. If any of the arguments to use_memo change during a component refresh (checked with ==), the value will be recomputed.

Parameters

Returns

Examples

local function increment(n)
    return n + 1
end

local function make_listener(set_count)
    return function()
        set_count(increment)
    end
end

local counter_button = editor.ui.component(function(props)
    local count, set_count = editor.ui.use_state(props.count)
    local on_pressed = editor.ui.use_memo(make_listener, set_count)
    return editor.ui.text_button {
        text = tostring(count),
        on_pressed = on_pressed
    }
end)

editor.ui.use_state

Type: FUNCTION A hook that adds local state to the component. See editor.ui.component for hooks caveats and rules. If any of the arguments to use_state change during a component refresh (checked with ==), the current state will be reset to the initial one.

Parameters

Returns

Examples

local function increment(n)
  return n + 1
end

local counter_button = editor.ui.component(function(props)
  local count, set_count = editor.ui.use_state(props.count)
  return editor.ui.text_button {
    text = tostring(count),
    on_pressed = function()
      set_count(increment)
    end
  }
end)

editor.ui.vertical

Type: FUNCTION Layout container that places its children in a vertical column one after another

Parameters

Returns

editor.ui.vertical.props

Type: STRUCT Properties for editor.ui.vertical

Members

editor.version

Type: VARIABLE A string, version name of Defold

http.request

Type: FUNCTION Perform an HTTP request

Parameters

Returns

http.request.method

Type: TYPEDEF HTTP request method, either a common method or a custom method string

Parameters

http.request.options

Type: STRUCT Options for http.request

Members

http.request.response

Type: STRUCT Response returned by http.request

Members

http.response

Type: TYPEDEF HTTP server response

Parameters

http.route

Type: TYPEDEF HTTP server route

Parameters

http.server.external_file_response

Type: FUNCTION Create HTTP response that will stream the content of a file defined by the path

Parameters

Returns

http.server.handler

Type: TYPEDEF HTTP server request handler

Parameters

http.server.json_response

Type: FUNCTION Create HTTP response with a JSON value

Parameters

Returns

http.server.local_url

Type: CONSTANT Editor’s HTTP server local url

Parameters

http.server.port

Type: CONSTANT Editor’s HTTP server port

Parameters

http.server.request

Type: STRUCT HTTP server request

Members

http.server.resource_response

Type: FUNCTION Create HTTP response that will stream the content of a resource defined by the resource path

Parameters

Returns

http.server.response

Type: FUNCTION Create HTTP response

Parameters

Returns

http.server.route

Type: FUNCTION Create route definition for the editor’s HTTP server

Parameters

Returns

Examples

Receive JSON and respond with JSON:

http.server.route(
  "/json", "POST", "json",
  function(request)
    pprint(request.body)
    return 200
  end
)

Extract parts of the path:

http.server.route(
  "/users/{user}/orders",
  function(request)
    print(request.user)
  end
)

Simple file server:

http.server.route(
  "/files/{*file}",
  function(request)
    local attrs = editor.external_file_attributes(request.file)
    if attrs.is_file then
      return http.server.external_file_response(request.file)
    elseif attrs.is_directory then
      return 400
    else
      return 404
    end
  end
)

http.server.url

Type: CONSTANT Editor’s HTTP server url

Parameters

image.load_file

Type: FUNCTION Load an image file for reading

Parameters

Returns

image.pixel

Type: FUNCTION Return the color of a pixel from a loaded image. Coordinates are 1-based, with 1, 1 at the top-left corner.

Parameters

Returns

image.pixels

Type: FUNCTION Iterate over pixels in a loaded image. The iterator returns pixels row by row from top-left to bottom-right. Coordinates are 1-based.

Parameters

Returns

Examples

local img = image.load_file("assets/source.png")
local width, height = image.size(img)
for x, y, r, g, b, a in image.pixels(img) do
  print(x, y, r, g, b, a)
end

image.size

Type: FUNCTION Return the width and height of a loaded image.

Parameters

Returns

json.decode

Type: FUNCTION Decode JSON string to Lua value

Parameters

json.decode.options

Type: STRUCT Options for json.decode

Members

json.encode

Type: FUNCTION Encode Lua value to JSON string

Parameters

localization.and_list

Type: FUNCTION Create a message pattern that renders a list with the “and” conjunction (for example: a, b, and c) once it is stringified

Parameters

Returns

localization.concat

Type: FUNCTION Create a message pattern that concatenates values (similar to table.concat) and performs the actual concatenation when stringified

Parameters

Returns

localization.message

Type: FUNCTION Create a message pattern for a localization key defined in an .editor_localization file; the actual localization happens when the returned value is stringified

Parameters

Returns

localization.or_list

Type: FUNCTION Create a message pattern that renders a list with the “or” conjunction (for example: a, b, or c) once it is stringified

Parameters

Returns

pprint

Type: FUNCTION Pretty-print Lua values

Parameters

tilemap.tiles.clear

Type: FUNCTION Remove all tiles

Parameters

Returns

tilemap.tiles.get_info

Type: FUNCTION Get full information from a tile at a particular coordinate

Parameters

Returns

tilemap.tiles.get_info.result

Type: STRUCT Full tile information returned by tilemap.tiles.get_info

Members

tilemap.tiles.get_tile

Type: FUNCTION Get a tile index at a particular coordinate

Parameters

Returns

tilemap.tiles.iterator

Type: FUNCTION Create an iterator over all tiles in a tiles data structure When iterating using for loop, each iteration returns x, y and tile index of a tile in a tile map

Parameters

Returns

Examples

Iterate over all tiles in a tile map:

local layers = editor.get("/level.tilemap", "layers")
for i = 1, #layers do
  local tiles = editor.get(layers[i], "tiles")
  for x, y, i in tilemap.tiles.iterator(tiles) do
    print(x, y, i)
  end
end

tilemap.tiles.new

Type: FUNCTION Create a new unbounded 2d grid data structure for storing tilemap layer tiles

Returns

tilemap.tiles.remove

Type: FUNCTION Remove a tile at a particular coordinate

Parameters

Returns

tilemap.tiles.set

Type: FUNCTION Set a tile at a particular coordinate

Parameters

Returns

tilemap.tiles.set.info

Type: STRUCT Tile information accepted by tilemap.tiles.set

Members

zip.METHOD

Type: ENUM Constants for zip compression methods

Parameters

Members

zip.ON_CONFLICT

Type: ENUM Constants defining conflict resolution strategies for zip archive extraction

Parameters

Members

zip.pack

Type: FUNCTION Create a ZIP archive

Parameters

Examples

Archive a file and a folder:

zip.pack("build.zip", {"build", "game.project"})

Change the location of the files within the archive:

zip.pack("build.zip", {
  {"build/wasm-web", "."},
  {"configs/prod.json", "config.json"}
})

Create archive without compression (much faster to create the archive, bigger archive file size, allows mmap access):

zip.pack("build.zip", {method = zip.METHOD.STORED}, {
  "build",
  "resources"
})

Don’t compress one of the folders:

zip.pack("build.zip", {
  {"assets", method = zip.METHOD.STORED},
  "build/wasm-web"
})

Include files from outside the project:

zip.pack("build.zip", {
  "build",
  {"../secrets/auth-key.txt", "auth-key.txt"}
})

zip.pack.entries

Type: TYPEDEF Entries included in a ZIP archive

Parameters

zip.pack.entry

Type: TYPEDEF ZIP entry containing a source path, optional archive target path, and optional compression settings

Parameters

zip.pack.options

Type: STRUCT Options for zip.pack

Members

zip.unpack

Type: FUNCTION Extract a ZIP archive

Parameters

Examples

Extract everything to a build dir:

zip.unpack("build/dev/resources.zip")

Extract to a different directory:

zip.unpack(
  "build/dev/resources.zip",
  "build/dev/tmp",
)

Extract while overwriting existing files on conflict:

zip.unpack(
  "build/dev/resources.zip",
  {on_conflict = zip.ON_CONFLICT.OVERWRITE}
)

Extract a single file:

zip.unpack(
  "build/dev/resources.zip",
  {"config.json"}
)

zip.unpack.options

Type: STRUCT Options for zip.unpack

Members

zlib.deflate

Type: FUNCTION Deflate (compress) a buffer

Parameters

Returns

zlib.inflate

Type: FUNCTION Inflate (decompress) a buffer

Parameters

Returns