diff --git a/.gitignore b/.gitignore index a32d29f..b9c960c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ Thumbs.db *.pyc .project .cproject -builtins \ No newline at end of file +builtins +_site diff --git a/README.md b/README.md index d5c9d85..1f94cd0 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,11 @@ -# extension-iap -In-app purchase extension for Defold +# In-app purchase extension for Defold + +This is a Defold [native extension](https://www.defold.com/manuals/extensions/) which provides access to In-app purchase functionality on iOS, Android (Google Play and Amazon) and Facebook Canvas platforms. + +To learn more please visit the [documentation page](https://defold.github.io/extension-iap/) for this extension. + +[The manual](https://defold.com/manuals/iap/) is available on the official Defold site. + +--- + +If you have any issues, questions or suggestions please [create an issue](https://github.com/defold/extension-iap/issues). diff --git a/docs/Gemfile b/docs/Gemfile new file mode 100644 index 0000000..37f5eaa --- /dev/null +++ b/docs/Gemfile @@ -0,0 +1,2 @@ +source 'https://rubygems.org' +gem 'github-pages', group: :jekyll_plugins diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock new file mode 100644 index 0000000..8351a0e --- /dev/null +++ b/docs/Gemfile.lock @@ -0,0 +1,248 @@ +GEM + remote: https://rubygems.org/ + specs: + activesupport (4.2.11.1) + i18n (~> 0.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + addressable (2.6.0) + public_suffix (>= 2.0.2, < 4.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.11.1) + colorator (1.1.0) + commonmarker (0.17.13) + ruby-enum (~> 0.5) + concurrent-ruby (1.1.5) + dnsruby (1.61.2) + addressable (~> 2.5) + em-websocket (0.5.1) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0.6.0) + ethon (0.12.0) + ffi (>= 1.3.0) + eventmachine (1.2.7) + execjs (2.7.0) + faraday (0.15.4) + multipart-post (>= 1.2, < 3) + ffi (1.11.1) + forwardable-extended (2.6.0) + gemoji (3.0.1) + github-pages (198) + activesupport (= 4.2.11.1) + github-pages-health-check (= 1.16.1) + jekyll (= 3.8.5) + jekyll-avatar (= 0.6.0) + jekyll-coffeescript (= 1.1.1) + jekyll-commonmark-ghpages (= 0.1.5) + jekyll-default-layout (= 0.1.4) + jekyll-feed (= 0.11.0) + jekyll-gist (= 1.5.0) + jekyll-github-metadata (= 2.12.1) + jekyll-mentions (= 1.4.1) + jekyll-optional-front-matter (= 0.3.0) + jekyll-paginate (= 1.1.0) + jekyll-readme-index (= 0.2.0) + jekyll-redirect-from (= 0.14.0) + jekyll-relative-links (= 0.6.0) + jekyll-remote-theme (= 0.3.1) + jekyll-sass-converter (= 1.5.2) + jekyll-seo-tag (= 2.5.0) + jekyll-sitemap (= 1.2.0) + jekyll-swiss (= 0.4.0) + jekyll-theme-architect (= 0.1.1) + jekyll-theme-cayman (= 0.1.1) + jekyll-theme-dinky (= 0.1.1) + jekyll-theme-hacker (= 0.1.1) + jekyll-theme-leap-day (= 0.1.1) + jekyll-theme-merlot (= 0.1.1) + jekyll-theme-midnight (= 0.1.1) + jekyll-theme-minimal (= 0.1.1) + jekyll-theme-modernist (= 0.1.1) + jekyll-theme-primer (= 0.5.3) + jekyll-theme-slate (= 0.1.1) + jekyll-theme-tactile (= 0.1.1) + jekyll-theme-time-machine (= 0.1.1) + jekyll-titles-from-headings (= 0.5.1) + jemoji (= 0.10.2) + kramdown (= 1.17.0) + liquid (= 4.0.0) + listen (= 3.1.5) + mercenary (~> 0.3) + minima (= 2.5.0) + nokogiri (>= 1.8.5, < 2.0) + rouge (= 2.2.1) + terminal-table (~> 1.4) + github-pages-health-check (1.16.1) + addressable (~> 2.3) + dnsruby (~> 1.60) + octokit (~> 4.0) + public_suffix (~> 3.0) + typhoeus (~> 1.3) + html-pipeline (2.11.1) + activesupport (>= 2) + nokogiri (>= 1.4) + http_parser.rb (0.6.0) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + jekyll (3.8.5) + addressable (~> 2.4) + colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (~> 0.7) + jekyll-sass-converter (~> 1.0) + jekyll-watch (~> 2.0) + kramdown (~> 1.14) + liquid (~> 4.0) + mercenary (~> 0.3.3) + pathutil (~> 0.9) + rouge (>= 1.7, < 4) + safe_yaml (~> 1.0) + jekyll-avatar (0.6.0) + jekyll (~> 3.0) + jekyll-coffeescript (1.1.1) + coffee-script (~> 2.2) + coffee-script-source (~> 1.11.1) + jekyll-commonmark (1.3.1) + commonmarker (~> 0.14) + jekyll (>= 3.7, < 5.0) + jekyll-commonmark-ghpages (0.1.5) + commonmarker (~> 0.17.6) + jekyll-commonmark (~> 1) + rouge (~> 2) + jekyll-default-layout (0.1.4) + jekyll (~> 3.0) + jekyll-feed (0.11.0) + jekyll (~> 3.3) + jekyll-gist (1.5.0) + octokit (~> 4.2) + jekyll-github-metadata (2.12.1) + jekyll (~> 3.4) + octokit (~> 4.0, != 4.4.0) + jekyll-mentions (1.4.1) + html-pipeline (~> 2.3) + jekyll (~> 3.0) + jekyll-optional-front-matter (0.3.0) + jekyll (~> 3.0) + jekyll-paginate (1.1.0) + jekyll-readme-index (0.2.0) + jekyll (~> 3.0) + jekyll-redirect-from (0.14.0) + jekyll (~> 3.3) + jekyll-relative-links (0.6.0) + jekyll (~> 3.3) + jekyll-remote-theme (0.3.1) + jekyll (~> 3.5) + rubyzip (>= 1.2.1, < 3.0) + jekyll-sass-converter (1.5.2) + sass (~> 3.4) + jekyll-seo-tag (2.5.0) + jekyll (~> 3.3) + jekyll-sitemap (1.2.0) + jekyll (~> 3.3) + jekyll-swiss (0.4.0) + jekyll-theme-architect (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-cayman (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-dinky (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-hacker (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-leap-day (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-merlot (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-midnight (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-minimal (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-modernist (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-primer (0.5.3) + jekyll (~> 3.5) + jekyll-github-metadata (~> 2.9) + jekyll-seo-tag (~> 2.0) + jekyll-theme-slate (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-tactile (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-time-machine (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-titles-from-headings (0.5.1) + jekyll (~> 3.3) + jekyll-watch (2.2.1) + listen (~> 3.0) + jemoji (0.10.2) + gemoji (~> 3.0) + html-pipeline (~> 2.2) + jekyll (~> 3.0) + kramdown (1.17.0) + liquid (4.0.0) + listen (3.1.5) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + ruby_dep (~> 1.2) + mercenary (0.3.6) + mini_portile2 (2.4.0) + minima (2.5.0) + jekyll (~> 3.5) + jekyll-feed (~> 0.9) + jekyll-seo-tag (~> 2.1) + minitest (5.11.3) + multipart-post (2.1.1) + nokogiri (1.10.3) + mini_portile2 (~> 2.4.0) + octokit (4.14.0) + sawyer (~> 0.8.0, >= 0.5.3) + pathutil (0.16.2) + forwardable-extended (~> 2.6) + public_suffix (3.1.1) + rb-fsevent (0.10.3) + rb-inotify (0.10.0) + ffi (~> 1.0) + rouge (2.2.1) + ruby-enum (0.7.2) + i18n + ruby_dep (1.5.0) + rubyzip (1.2.3) + safe_yaml (1.0.5) + sass (3.7.4) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sawyer (0.8.2) + addressable (>= 2.3.5) + faraday (> 0.8, < 2.0) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + thread_safe (0.3.6) + typhoeus (1.3.1) + ethon (>= 0.9.0) + tzinfo (1.2.5) + thread_safe (~> 0.1) + unicode-display_width (1.6.0) + +PLATFORMS + ruby + +DEPENDENCIES + github-pages + +BUNDLED WITH + 2.0.2 diff --git a/docs/_config.yml b/docs/_config.yml new file mode 100644 index 0000000..2ca3fd3 --- /dev/null +++ b/docs/_config.yml @@ -0,0 +1 @@ +title: "extension-iap" diff --git a/docs/_data/api.yml b/docs/_data/api.yml new file mode 100644 index 0000000..1a02b47 --- /dev/null +++ b/docs/_data/api.yml @@ -0,0 +1,299 @@ +- name: iap + type: table + desc: Functions and constants for doing in-app purchases. Supported on iOS, Android (Google Play and Amazon) + and Facebook Canvas platforms. + [icon:ios] [icon:googleplay] [icon:amazon] [icon:facebook] + members: + +#***************************************************************************************************** + + - name: buy + type: function + desc: Sets the listener function for inter-app communication events. + parameters: + - name: id + type: string + desc: product to buy + + - name: options + type: table + desc: optional parameters as properties. The following parameters can be set + members: + - name: request_id + type: string + desc: Facebook only. [icon:facebook] Optional custom unique request id to + set for this transaction. The id becomes attached to the payment within the Graph API. + + examples: + - desc: |- + ```lua + local function iap_listener(self, transaction, error) + if error == nil then + -- purchase is successful. + print(transaction.date) + -- required if auto finish transactions is disabled in project settings + if (transaction.state == iap.TRANS_STATE_PURCHASED) then + -- do server-side verification of purchase here.. + iap.finish(transaction) + end + else + print(error.error, error.reason) + end + end + + function init(self) + iap.set_listener(iap_listener) + iap.buy("my_iap") + end + ``` + +#***************************************************************************************************** + + - name: finish + type: function + desc: Explicitly finish a product transaction. + [icon:attention] Calling iap.finish is required on a successful transaction + if `auto_finish_transactions` is disabled in project settings. Calling this function + with `auto_finish_transactions` set will be ignored and a warning is printed. + The `transaction.state` field must equal `iap.TRANS_STATE_PURCHASED`. + parameters: + - name: transaction + type: table + desc: transaction table parameter as supplied in listener callback + +#***************************************************************************************************** + + - name: get_provider_id + type: function + desc: Get current iap provider + returns: + - name: provider_id + type: constant + desc: one of the following values + + - `iap.PROVIDER_ID_GOOGLE` + + - `iap.PROVIDER_ID_AMAZON` + + - `iap.PROVIDER_ID_APPLE` + + - `iap.PROVIDER_ID_FACEBOOK` + +#***************************************************************************************************** + + - name: list + type: function + desc: Get a list of all avaliable iap products. + parameters: + - name: ids + type: table + desc: table (array) of identifiers to get products from + + - name: callback + type: function + desc: result callback taking the following parameters + parameters: + - name: self + type: object + desc: The current object. + + - name: products + type: table + desc: a table describing the available iap products. + members: + - name: ident + type: string + desc: The product identifier. + + - name: title + type: string + desc: The product title. + + - name: description + type: string + desc: The product description. + + - name: price + type: number + desc: The price of the product. + + - name: price_string + type: string + desc: The price of the product, as a formatted string (amount and currency symbol). + + - name: currency_code + type: string + desc: The currency code. On Google Play, this reflects the merchant's locale, instead of the user's. + [icon:ios] [icon:googleplay] [icon:facebook] + + - name: error + type: table + desc: a table containing error information. `nil` if there is no error. - `error` (the error message) + + examples: + - desc: |- + ```lua + local function iap_callback(self, products, error) + if error == nil then + for k,p in pairs(products) do + -- present the product + print(p.title) + print(p.description) + end + else + print(error.error) + end + end + + function init(self) + iap.list({"my_iap"}, iap_callback) + end + ``` + +#***************************************************************************************************** + + - name: restore + type: function + desc: Restore previously purchased products. + returns: + - name: success + type: boolean + desc: value is `true` if current store supports handling + restored transactions, otherwise `false`. + +#***************************************************************************************************** + + - name: set_listener + type: function + desc: Set the callback function to receive purchase transaction events. + parameters: + - name: listener + type: function + desc: listener callback function. Pass an empty function if you no longer wish to receive callbacks. + parameters: + - name: self + type: object + desc: The current object. + + - name: transaction + type: table + desc: a table describing the transaction. + members: + - name: ident + type: string + desc: The product identifier. + + - name: state + type: string + desc: The transaction state. One of the following + + - `iap.TRANS_STATE_FAILED` + + - `iap.TRANS_STATE_PURCHASED` + + - `iap.TRANS_STATE_PURCHASING` + + - `iap.TRANS_STATE_RESTORED` + + - `iap.TRANS_STATE_UNVERIFIED` + + - name: date + type: string + desc: The date and time for the transaction. + + - name: trans_ident + type: string + desc: The transaction identifier. This field is only set when `state` is + `TRANS_STATE_RESTORED`, `TRANS_STATE_UNVERIFIED` or `TRANS_STATE_PURCHASED`. + + - name: receipt + type: string + desc: The transaction receipt. This field is only set when `state` is `TRANS_STATE_PURCHASED` or `TRANS_STATE_UNVERIFIED`. + + - name: original_trans + type: string + desc: Apple only[icon:apple]. The original transaction. This field is only set when `state` is `TRANS_STATE_RESTORED`. + + - name: signature + type: string + desc: Google Play only[icon:googleplay]. A string containing the signature of the purchase data that was signed with the private key of the developer. + + - name: request_id + type: string + desc: Facebook only[icon:facebook]. This field is set to the optional custom unique request id `request_id` if set in the `iap.buy()` call parameters. + + - name: user_id + type: string + desc: Amazon Pay only[icon:amazon]. The user ID. + + - name: is_sandbox_mode + type: boolean + desc: Amazon Pay only[icon:amazon]. If `true`, the SDK is running in Sandbox mode. + This only allows interactions with the Amazon AppTester. Use this mode only for testing locally. + + - name: cancel_date + type: string + desc: Amazon Pay only[icon:amazon]. The cancel date for the purchase. This field is only set if the purchase is canceled. + + - name: canceled + type: string + desc: Amazon Pay only[icon:amazon]. Is set to `true` if the receipt was canceled or has expired; otherwise `false`. + + - name: error + type: table + desc: a table containing error information. `nil` if there is no error. `error` - the error message. + `reason` - the reason for the error, value can be one of the following constants + + - `iap.REASON_UNSPECIFIED` + + - `iap.REASON_USER_CANCELED` + +#***************************************************************************************************** + + - name: PROVIDER_ID_AMAZON + type: number + desc: provider id for Amazon + + - name: PROVIDER_ID_APPLE + type: number + desc: provider id for Apple + + - name: PROVIDER_ID_FACEBOOK + type: number + desc: provider id for Facebook + + - name: PROVIDER_ID_GOOGLE + type: number + desc: iap provider id for Google + + - name: REASON_UNSPECIFIED + type: number + desc: unspecified error reason + + - name: REASON_USER_CANCELED + type: number + desc: user canceled reason + + - name: TRANS_STATE_FAILED + type: number + desc: transaction failed state + + - name: TRANS_STATE_PURCHASED + type: number + desc: transaction purchased state + + - name: TRANS_STATE_PURCHASING + type: number + desc: transaction purchasing state + This is an intermediate mode followed by TRANS_STATE_PURCHASED. Store provider support dependent. + + - name: TRANS_STATE_RESTORED + type: number + desc: transaction restored state + This is only available on store providers supporting restoring purchases. + + - name: TRANS_STATE_UNVERIFIED + type: number + desc: transaction unverified state, requires verification of purchase + + \ No newline at end of file diff --git a/docs/_includes/description.md b/docs/_includes/description.md new file mode 100644 index 0000000..bf81741 --- /dev/null +++ b/docs/_includes/description.md @@ -0,0 +1,38 @@ +{% assign truncate = 10000 %} +{% if include.truncate %} + {% assign truncate = include.truncate %} +{% endif %} +{{ include.desc + | truncate: truncate + | replace: "[type:string]","string" + | replace: "[type:number]","number" + | replace: "[type:table]","table" + | replace: "[icon:attention]","

" + | replace: "[icon:android]", "" + | replace: "[icon:gameroom]", "" + | replace: "[icon:apple]", "" + | replace: "[icon:clipboard]", "" + | replace: "[icon:king]", "" + | replace: "[icon:defold]", "" + | replace: "[icon:search]", "" + | replace: "[icon:link-ext]", "" + | replace: "[icon:link]", "" + | replace: "[icon:amazon]", "" + | replace: "[icon:html5]", "" + | replace: "[icon:ios]", "" + | replace: "[icon:linux]", "" + | replace: "[icon:windows]", "" + | replace: "[icon:macos]", "" + | replace: "[icon:clock]", "" + | replace: "[icon:star]", "" + | replace: "[icon:googleplay]", "" + | replace: "[icon:dropbox]", "" + | replace: "[icon:twitter]", "" + | replace: "[icon:slack]", "" + | replace: "[icon:instagram]", "" + | replace: "[icon:steam]", "" + | replace: "[icon:github]", "" + | replace: "[icon:facebook]", "" + + | markdownify +}} \ No newline at end of file diff --git a/docs/_includes/type-function.md b/docs/_includes/type-function.md new file mode 100644 index 0000000..afc51be --- /dev/null +++ b/docs/_includes/type-function.md @@ -0,0 +1,23 @@ + + + + + + + + + + {% for param in include.params %} + + + + + + {% endfor %} + +
ParameterTypeDescription
{{ param.name }}{{ param.type }}{% include description.md desc=param.desc %} + + {% if param.type == "table" %} + {% include type-table.md fields=param.members %} + {% endif %} +
diff --git a/docs/_includes/type-table.md b/docs/_includes/type-table.md new file mode 100644 index 0000000..5905214 --- /dev/null +++ b/docs/_includes/type-table.md @@ -0,0 +1,11 @@ + diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html new file mode 100644 index 0000000..c118ad6 --- /dev/null +++ b/docs/_layouts/default.html @@ -0,0 +1,38 @@ + + + + + + + + + + + {{ site.title }} + + +
+
+

Defold In-app purchase extension API documentation

+

Functions and constants for doing in-app purchase. Supported on iOS, Android (Google Play and Amazon) and Facebook Canvas.

+ +

To use this library in your Defold project, add the following URL to your game.project dependencies: +

https://github.com/defold/extension-iap/archive/master.zip
+

+ +

We recommend using a link to a zip file of a specific release.

+ +

The source code can be viewed at: https://github.com/defold/extension-iap

+ +
+
+
+ + {{ content }} + +
+
+ + diff --git a/docs/fonts.css b/docs/fonts.css new file mode 100644 index 0000000..1230c7f --- /dev/null +++ b/docs/fonts.css @@ -0,0 +1,67 @@ +@font-face { + font-family: 'Noto Sans'; + font-weight: 400; + font-style: normal; + src: url('fonts/Noto-Sans-regular/Noto-Sans-regular.eot'); + src: url('fonts/Noto-Sans-regular/Noto-Sans-regular.eot?#iefix') format('embedded-opentype'), + local('Noto Sans'), + local('Noto-Sans-regular'), + url('fonts/Noto-Sans-regular/Noto-Sans-regular.woff2') format('woff2'), + url('fonts/Noto-Sans-regular/Noto-Sans-regular.woff') format('woff'), + url('fonts/Noto-Sans-regular/Noto-Sans-regular.ttf') format('truetype'), + url('fonts/Noto-Sans-regular/Noto-Sans-regular.svg#NotoSans') format('svg'); +} + +@font-face { + font-family: 'Noto Sans'; + font-weight: 700; + font-style: normal; + src: url('fonts/Noto-Sans-700/Noto-Sans-700.eot'); + src: url('fonts/Noto-Sans-700/Noto-Sans-700.eot?#iefix') format('embedded-opentype'), + local('Noto Sans Bold'), + local('Noto-Sans-700'), + url('fonts/Noto-Sans-700/Noto-Sans-700.woff2') format('woff2'), + url('fonts/Noto-Sans-700/Noto-Sans-700.woff') format('woff'), + url('fonts/Noto-Sans-700/Noto-Sans-700.ttf') format('truetype'), + url('fonts/Noto-Sans-700/Noto-Sans-700.svg#NotoSans') format('svg'); +} + +@font-face { + font-family: 'Noto Sans'; + font-weight: 400; + font-style: italic; + src: url('fonts/Noto-Sans-italic/Noto-Sans-italic.eot'); + src: url('fonts/Noto-Sans-italic/Noto-Sans-italic.eot?#iefix') format('embedded-opentype'), + local('Noto Sans Italic'), + local('Noto-Sans-italic'), + url('fonts/Noto-Sans-italic/Noto-Sans-italic.woff2') format('woff2'), + url('fonts/Noto-Sans-italic/Noto-Sans-italic.woff') format('woff'), + url('fonts/Noto-Sans-italic/Noto-Sans-italic.ttf') format('truetype'), + url('fonts/Noto-Sans-italic/Noto-Sans-italic.svg#NotoSans') format('svg'); +} + +@font-face { + font-family: 'Noto Sans'; + font-weight: 700; + font-style: italic; + src: url('fonts/Noto-Sans-700italic/Noto-Sans-700italic.eot'); + src: url('fonts/Noto-Sans-700italic/Noto-Sans-700italic.eot?#iefix') format('embedded-opentype'), + local('Noto Sans Bold Italic'), + local('Noto-Sans-700italic'), + url('fonts/Noto-Sans-700italic/Noto-Sans-700italic.woff2') format('woff2'), + url('fonts/Noto-Sans-700italic/Noto-Sans-700italic.woff') format('woff'), + url('fonts/Noto-Sans-700italic/Noto-Sans-700italic.ttf') format('truetype'), + url('fonts/Noto-Sans-700italic/Noto-Sans-700italic.svg#NotoSans') format('svg'); +} + +@font-face { + font-family: fontello; + font-weight: 400; + font-style: normal; + src: url(fonts/fontello/fontello_ef8859ce.eot); + src: url(fonts/fontello/fontello_ef8859ce.eot#iefix) format("embedded-opentype"), + url(fonts/fontello/fontello_248ab5dd.woff2) format("woff2"), + url(fonts/fontello/fontello_b6287553.woff) format("woff"), + url(fonts/fontello/fontello_df5eac8f.ttf) format("truetype"), + url(fonts/fontello/fontello_793be834.svg#fontello) format("svg"); +} diff --git a/docs/fonts/Noto-Sans-700/Noto-Sans-700.eot b/docs/fonts/Noto-Sans-700/Noto-Sans-700.eot new file mode 100755 index 0000000..03bf93f Binary files /dev/null and b/docs/fonts/Noto-Sans-700/Noto-Sans-700.eot differ diff --git a/docs/fonts/Noto-Sans-700/Noto-Sans-700.svg b/docs/fonts/Noto-Sans-700/Noto-Sans-700.svg new file mode 100755 index 0000000..925fe47 --- /dev/null +++ b/docs/fonts/Noto-Sans-700/Noto-Sans-700.svg @@ -0,0 +1,336 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/fonts/Noto-Sans-700/Noto-Sans-700.ttf b/docs/fonts/Noto-Sans-700/Noto-Sans-700.ttf new file mode 100755 index 0000000..4599e3c Binary files /dev/null and b/docs/fonts/Noto-Sans-700/Noto-Sans-700.ttf differ diff --git a/docs/fonts/Noto-Sans-700/Noto-Sans-700.woff b/docs/fonts/Noto-Sans-700/Noto-Sans-700.woff new file mode 100755 index 0000000..9d0b78d Binary files /dev/null and b/docs/fonts/Noto-Sans-700/Noto-Sans-700.woff differ diff --git a/docs/fonts/Noto-Sans-700/Noto-Sans-700.woff2 b/docs/fonts/Noto-Sans-700/Noto-Sans-700.woff2 new file mode 100755 index 0000000..55fc44b Binary files /dev/null and b/docs/fonts/Noto-Sans-700/Noto-Sans-700.woff2 differ diff --git a/docs/fonts/Noto-Sans-700italic/Noto-Sans-700italic.eot b/docs/fonts/Noto-Sans-700italic/Noto-Sans-700italic.eot new file mode 100755 index 0000000..cb97b2b Binary files /dev/null and b/docs/fonts/Noto-Sans-700italic/Noto-Sans-700italic.eot differ diff --git a/docs/fonts/Noto-Sans-700italic/Noto-Sans-700italic.svg b/docs/fonts/Noto-Sans-700italic/Noto-Sans-700italic.svg new file mode 100755 index 0000000..abdafc0 --- /dev/null +++ b/docs/fonts/Noto-Sans-700italic/Noto-Sans-700italic.svg @@ -0,0 +1,334 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/fonts/Noto-Sans-700italic/Noto-Sans-700italic.ttf b/docs/fonts/Noto-Sans-700italic/Noto-Sans-700italic.ttf new file mode 100755 index 0000000..6640dbe Binary files /dev/null and b/docs/fonts/Noto-Sans-700italic/Noto-Sans-700italic.ttf differ diff --git a/docs/fonts/Noto-Sans-700italic/Noto-Sans-700italic.woff b/docs/fonts/Noto-Sans-700italic/Noto-Sans-700italic.woff new file mode 100755 index 0000000..209739e Binary files /dev/null and b/docs/fonts/Noto-Sans-700italic/Noto-Sans-700italic.woff differ diff --git a/docs/fonts/Noto-Sans-700italic/Noto-Sans-700italic.woff2 b/docs/fonts/Noto-Sans-700italic/Noto-Sans-700italic.woff2 new file mode 100755 index 0000000..f5525aa Binary files /dev/null and b/docs/fonts/Noto-Sans-700italic/Noto-Sans-700italic.woff2 differ diff --git a/docs/fonts/Noto-Sans-italic/Noto-Sans-italic.eot b/docs/fonts/Noto-Sans-italic/Noto-Sans-italic.eot new file mode 100755 index 0000000..a997349 Binary files /dev/null and b/docs/fonts/Noto-Sans-italic/Noto-Sans-italic.eot differ diff --git a/docs/fonts/Noto-Sans-italic/Noto-Sans-italic.svg b/docs/fonts/Noto-Sans-italic/Noto-Sans-italic.svg new file mode 100755 index 0000000..dcd8fc8 --- /dev/null +++ b/docs/fonts/Noto-Sans-italic/Noto-Sans-italic.svg @@ -0,0 +1,337 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/fonts/Noto-Sans-italic/Noto-Sans-italic.ttf b/docs/fonts/Noto-Sans-italic/Noto-Sans-italic.ttf new file mode 100755 index 0000000..7f75a2d Binary files /dev/null and b/docs/fonts/Noto-Sans-italic/Noto-Sans-italic.ttf differ diff --git a/docs/fonts/Noto-Sans-italic/Noto-Sans-italic.woff b/docs/fonts/Noto-Sans-italic/Noto-Sans-italic.woff new file mode 100755 index 0000000..6dce67c Binary files /dev/null and b/docs/fonts/Noto-Sans-italic/Noto-Sans-italic.woff differ diff --git a/docs/fonts/Noto-Sans-italic/Noto-Sans-italic.woff2 b/docs/fonts/Noto-Sans-italic/Noto-Sans-italic.woff2 new file mode 100755 index 0000000..a9c14c4 Binary files /dev/null and b/docs/fonts/Noto-Sans-italic/Noto-Sans-italic.woff2 differ diff --git a/docs/fonts/Noto-Sans-regular/Noto-Sans-regular.eot b/docs/fonts/Noto-Sans-regular/Noto-Sans-regular.eot new file mode 100755 index 0000000..15fc8bf Binary files /dev/null and b/docs/fonts/Noto-Sans-regular/Noto-Sans-regular.eot differ diff --git a/docs/fonts/Noto-Sans-regular/Noto-Sans-regular.svg b/docs/fonts/Noto-Sans-regular/Noto-Sans-regular.svg new file mode 100755 index 0000000..bd2894d --- /dev/null +++ b/docs/fonts/Noto-Sans-regular/Noto-Sans-regular.svg @@ -0,0 +1,335 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/fonts/Noto-Sans-regular/Noto-Sans-regular.ttf b/docs/fonts/Noto-Sans-regular/Noto-Sans-regular.ttf new file mode 100755 index 0000000..a83bbf9 Binary files /dev/null and b/docs/fonts/Noto-Sans-regular/Noto-Sans-regular.ttf differ diff --git a/docs/fonts/Noto-Sans-regular/Noto-Sans-regular.woff b/docs/fonts/Noto-Sans-regular/Noto-Sans-regular.woff new file mode 100755 index 0000000..17c8500 Binary files /dev/null and b/docs/fonts/Noto-Sans-regular/Noto-Sans-regular.woff differ diff --git a/docs/fonts/Noto-Sans-regular/Noto-Sans-regular.woff2 b/docs/fonts/Noto-Sans-regular/Noto-Sans-regular.woff2 new file mode 100755 index 0000000..a87d9cd Binary files /dev/null and b/docs/fonts/Noto-Sans-regular/Noto-Sans-regular.woff2 differ diff --git a/docs/fonts/fontello/fontello_248ab5dd.woff2 b/docs/fonts/fontello/fontello_248ab5dd.woff2 new file mode 100644 index 0000000..27685c9 Binary files /dev/null and b/docs/fonts/fontello/fontello_248ab5dd.woff2 differ diff --git a/docs/fonts/fontello/fontello_793be834.svg b/docs/fonts/fontello/fontello_793be834.svg new file mode 100644 index 0000000..e2a9d96 --- /dev/null +++ b/docs/fonts/fontello/fontello_793be834.svg @@ -0,0 +1,62 @@ + + + +Copyright (C) 2018 by original authors @ fontello.com + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/fontello/fontello_b6287553.woff b/docs/fonts/fontello/fontello_b6287553.woff new file mode 100644 index 0000000..82c9dd9 Binary files /dev/null and b/docs/fonts/fontello/fontello_b6287553.woff differ diff --git a/docs/fonts/fontello/fontello_df5eac8f.ttf b/docs/fonts/fontello/fontello_df5eac8f.ttf new file mode 100644 index 0000000..b5d9d9a Binary files /dev/null and b/docs/fonts/fontello/fontello_df5eac8f.ttf differ diff --git a/docs/fonts/fontello/fontello_ef8859ce.eot b/docs/fonts/fontello/fontello_ef8859ce.eot new file mode 100644 index 0000000..7700a31 Binary files /dev/null and b/docs/fonts/fontello/fontello_ef8859ce.eot differ diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..85ec5ad --- /dev/null +++ b/docs/index.md @@ -0,0 +1,121 @@ +--- +layout: default +--- +## Modules +{% for item in site.data.api %} +### {{ item.name }} +{% include description.md desc=item.desc %} +{% endfor %} + +
+ +## Enums + + +{% for module in site.data.api %} + {% for item in module.members %} + {% if item.type contains 'number' %} + + + + + + {% endif %} + {% endfor %} +{% endfor %} + +
{{ module.name }}.{{ item.name }}{{ item.desc | markdownify | replace: "[icon:attention]","

⚠️"}}
+ +
+ +## Functions + + +{% for module in site.data.api %} + {% for item in module.members %} + {% if item.type contains 'function' %} + + + + + {% endif %} + {% endfor %} +{% endfor %} + +
{{ module.name }}.{{ item.name }}(){% include description.md desc=item.desc %}
+ +{% for module in site.data.api %} + {% for function in module.members %} + {% if function.type contains 'function' %} +
+

{{ module.name }}.{{ function.name }}({% for param in function.parameters %}{{param.name}}{% unless forloop.last %}, {% endunless %}{% endfor %})

+{% include description.md desc=function.desc %} +{% if function.parameters %} + + + + + + + + + + {% for param in function.parameters %} + + + + + + {% endfor %} + +
ParameterTypeDescription
+ {{ param.name }} + {% if param.optional %} + (optional) + {% endif %} + {{ param.type }}{% include description.md desc=param.desc %} + {% if param.type == "function" %} + {% include type-function.md params=param.parameters %} + {% endif %} + {% if param.type == "table" %} + {% include type-table.md fields=param.members %} + {% endif %} +
+{% endif %} +{% if function.returns %} + + + + + + + + + +

Returns

+ {% for return in function.returns %} + + + + + + {% endfor %} + +
Return valueTypeDescription
{{ return.name }}{{ return.type }}{% include description.md desc=return.desc %} + {% if return.type == "table" %} + {% include type-table.md fields=return.members %} + {% endif %} +
+{% endif %} + +{% if function.examples %} +

Examples

+{% for example in function.examples %} +{{ example.desc | markdownify }} +{% endfor %} +{% endif %} +
+ + {% endif %} + {% endfor %} +{% endfor %} diff --git a/docs/rouge.css b/docs/rouge.css new file mode 100644 index 0000000..c8b3266 --- /dev/null +++ b/docs/rouge.css @@ -0,0 +1,342 @@ +.highlight table td { padding: 5px; } +.highlight table pre { margin: 0; } +.highlight .cm { + color: #999988; + font-style: italic; +} +.highlight .cp { + color: #999999; + font-weight: bold; +} +.highlight .c1 { + color: #999988; + font-style: italic; +} +.highlight .cs { + color: #999999; + font-weight: bold; + font-style: italic; +} +.highlight .c, .highlight .cd { + color: #999988; + font-style: italic; +} +.highlight .err { + color: #a61717; + background-color: #e3d2d2; +} +.highlight .gd { + color: #000000; + background-color: #ffdddd; +} +.highlight .ge { + color: #000000; + font-style: italic; +} +.highlight .gr { + color: #aa0000; +} +.highlight .gh { + color: #999999; +} +.highlight .gi { + color: #000000; + background-color: #ddffdd; +} +.highlight .go { + color: #888888; +} +.highlight .gp { + color: #555555; +} +.highlight .gs { + font-weight: bold; +} +.highlight .gu { + color: #aaaaaa; +} +.highlight .gt { + color: #aa0000; +} +.highlight .kc { + color: #000000; + font-weight: bold; +} +.highlight .kd { + color: #000000; + font-weight: bold; +} +.highlight .kn { + color: #000000; + font-weight: bold; +} +.highlight .kp { + color: #000000; + font-weight: bold; +} +.highlight .kr { + color: #000000; + font-weight: bold; +} +.highlight .kt { + color: #445588; + font-weight: bold; +} +.highlight .k, .highlight .kv { + color: #000000; + font-weight: bold; +} +.highlight .mf { + color: #009999; +} +.highlight .mh { + color: #009999; +} +.highlight .il { + color: #009999; +} +.highlight .mi { + color: #009999; +} +.highlight .mo { + color: #009999; +} +.highlight .m, .highlight .mb, .highlight .mx { + color: #009999; +} +.highlight .sb { + color: #d14; +} +.highlight .sc { + color: #d14; +} +.highlight .sd { + color: #d14; +} +.highlight .s2 { + color: #d14; +} +.highlight .se { + color: #d14; +} +.highlight .sh { + color: #d14; +} +.highlight .si { + color: #d14; +} +.highlight .sx { + color: #d14; +} +.highlight .sr { + color: #009926; +} +.highlight .s1 { + color: #d14; +} +.highlight .ss { + color: #990073; +} +.highlight .s { + color: #d14; +} +.highlight .na { + color: #008080; +} +.highlight .bp { + color: #999999; +} +.highlight .nb { + color: #0086B3; +} +.highlight .nc { + color: #445588; + font-weight: bold; +} +.highlight .no { + color: #008080; +} +.highlight .nd { + color: #3c5d5d; + font-weight: bold; +} +.highlight .ni { + color: #800080; +} +.highlight .ne { + color: #990000; + font-weight: bold; +} +.highlight .nf { + color: #990000; + font-weight: bold; +} +.highlight .nl { + color: #990000; + font-weight: bold; +} +.highlight .nn { + color: #555555; +} +.highlight .nt { + color: #000080; +} +.highlight .vc { + color: #008080; +} +.highlight .vg { + color: #008080; +} +.highlight .vi { + color: #008080; +} +.highlight .nv { + color: #008080; +} +.highlight .ow { + color: #000000; + font-weight: bold; +} +.highlight .o { + color: #000000; + font-weight: bold; +} +.highlight .w { + color: #bbbbbb; +} +.highlight { + background-color: #f8f8f8; +} + +.icon-amazon:before, .icon-android:before, .icon-apple:before, +.icon-attention:before, .icon-clipboard:before, .icon-clock:before, +.icon-defold:before, .icon-dropbox:before, .icon-facebook:before, +.icon-gameroom:before, .icon-github:before, .icon-googleplay:before, +.icon-html5:before, .icon-instagram:before, .icon-ios:before, .icon-king:before, +.icon-link-ext:before, .icon-link:before, .icon-linux:before, .icon-macos:before, +.icon-search:before, .icon-slack:before, .icon-star:before, .icon-steam:before, +.icon-twitter:before, .icon-windows:before { + font-family: fontello; + font-style: normal; + font-weight: 400; + speak: none; + display: inline-block; + text-decoration: inherit; + width: 1em; + margin-right: .2em; + text-align: center; + font-variant: normal; + text-transform: none; + line-height: 1em; + margin-left: .2em; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale +} + +.icon-gameroom:before { + content: "\E800" +} + +.icon-apple:before { + content: "\E809" +} + +.icon-clipboard:before { + content: "\E819" +} + +.icon-king:before { + content: "\E858" +} + +.icon-defold:before { + content: "\E859" +} + +.icon-search:before { + content: "\E86A" +} + +.icon-link-ext:before { + content: "\E86F" +} + +.icon-link:before { + content: "\E870" +} + +.icon-attention:before { + content: "\E871"; + color:#ffa500; +} + +.icon-amazon:before { + content: "\E872" +} + +.icon-android:before { + content: "\E873"; + color: #A4C639; +} + +.icon-html5:before { + content: "\E875"; + color:#f16529; +} + +.icon-ios:before { + content: "\E876"; + color:#147efb; +} + +.icon-linux:before { + content: "\E877" +} + +.icon-windows:before { + content: "\E878" +} + +.icon-macos:before { + content: "\E87A" +} + +.icon-clock:before { + content: "\E87B" +} + +.icon-star:before { + content: "\E87C" +} + +.icon-googleplay:before { + content: "\E87D" +} + +.icon-dropbox:before { + content: "\E87F" +} + +.icon-twitter:before { + content: "\E881" +} + +.icon-slack:before { + content: "\E883" +} + +.icon-instagram:before { + content: "\E884" +} + +.icon-steam:before { + content: "\E885" +} + +.icon-github:before { + content: "\E886" +} + +.icon-facebook:before { + content: "\E887" +} diff --git a/docs/style.css b/docs/style.css new file mode 100644 index 0000000..52b4ab0 --- /dev/null +++ b/docs/style.css @@ -0,0 +1,210 @@ +body { + background-color: #fff; + padding:50px; + font: 14px/1.5 "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + color:#727272; + font-weight:400; +} + +h1, h2, h3, h4, h5, h6 { + color:#222; + margin: 20px 0 20px; +} + +p, ul, ol, table, pre, dl { + margin: 20px 0 20px; +} + +h1, h2, h3 { + line-height:1.1; +} + +h1 { + font-size:28px; +} + +h2 { + color:#393939; +} + +h3, h4, h5, h6 { + color:#494949; +} + +.function-header { + margin-top: 60px; +} + +a { + color:#267CB9; + text-decoration:none; +} + +a:hover, a:focus { + color:#069; +} + +a small { + font-size:11px; + color:#777; + margin-top:-0.3em; + display:block; +} + +a:hover small { + color:#777; +} + +.wrapper { + width:860px; + margin:0 auto; +} + +.function-wrap { + border-left: 6px solid #eee; + padding-left: 10px; +} + +blockquote { + border-left:1px solid #e5e5e5; + margin:0; + padding:0 0 0 20px; + font-style:italic; +} + +code, pre { + font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal, Consolas, Liberation Mono, DejaVu Sans Mono, Courier New, monospace; + color:#333; +} + +table code, .inline-code-block { + background-color: #eee; + padding: 1px 4px; + margin: 2px; + border-radius: 4px; + display: inline-block; +} + +pre { + padding:8px 15px; + background: #f8f8f8; + border-radius:5px; + border:1px solid #e5e5e5; + overflow-x: auto; +} + +table { + width:100%; + border-collapse:collapse; +} + +th, td { + text-align:left; + vertical-align: top; + padding:5px 10px; + border-bottom:1px solid #e5e5e5; +} + +dt { + color:#444; + font-weight:700; +} + +th { + color:#444; +} + +img { + max-width:100%; +} + +header { + -webkit-font-smoothing:subpixel-antialiased; +} + +strong { + color:#222; + font-weight:700; +} + +section { + padding-bottom:50px; +} + +small { + font-size:11px; +} + +hr { + border:0; + background:#e5e5e5; + height:1px; + margin:0 0 20px; +} + +@media print, screen and (max-width: 960px) { + + div.wrapper { + width:auto; + margin:0; + } + + header, section, footer { + float:none; + position:static; + width:auto; + } + + header { + + } + + section { + border:1px solid #e5e5e5; + border-width:1px 0; + padding:20px 0; + margin:0 0 20px; + } + + header a small { + display:inline; + } + + header ul { + position:absolute; + right:50px; + top:52px; + } +} + +@media print, screen and (max-width: 720px) { + body { + word-wrap:break-word; + } + + header { + padding:0; + } + + header ul, header p.view { + position:static; + } + + pre, code { + word-wrap:normal; + } +} + +@media print, screen and (max-width: 480px) { + body { + padding:15px; + } +} + +@media print { + body { + padding:0.4in; + font-size:12pt; + color:#444; + } +}