diff --git a/README.md b/README.md index 905c0c6..b248ec5 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,6 @@ import { Address } from "@ideal-postcodes/api-typings"; let address: Address; ``` -![Typings Demo](https://img.ideal-postcodes.co.uk/api-typings/demo.svg) - ### Links - [Project Repository](https://github.com/ideal-postcodes/api-typings) @@ -46,19 +44,15 @@ Typings allow IDEs to provide a richer, more productive environment to develop i ![Autocomplete](https://img.ideal-postcodes.co.uk/api-typings/autocomplete.png) -### Type Checking - -Compile time checks that your library or application appropriately consumes objects and data types returned by our APIs and client libraries - -![Type Checking](https://img.ideal-postcodes.co.uk/api-typings/type_checking.svg) - ### Inline Documentation Our typings also bear documentation which can be rendered in your IDE as you work. ![VS Docs](https://img.ideal-postcodes.co.uk/api-typings/documentation.png) -![Docs](https://img.ideal-postcodes.co.uk/api-typings/documentation.svg) +### Type Checking + +Compile time checks that your library or application appropriately consumes objects and data types returned by our APIs and client libraries ### Non-Typescript Projects diff --git a/docs/globals.html b/docs/globals.html index 3290dbc..56d6f05 100644 --- a/docs/globals.html +++ b/docs/globals.html @@ -1026,25 +1026,34 @@
Address
, autocomplete suggestions AddressSuggestion
, API key status KeyStatus
)PostcodesResponse
, address autocomplete queries AddressSuggestionResponse
, address search queries AddressQueryResponse
)The full documentation for these types can be found at ideal-postcodes.github.io/api-typings.
Typings are exported to index.d.ts
when published to npm. The typings in this repository are defined in lib/index.ts
.
This typings repository allows you create Typescript integrations, which gives you the added benefits of static typing. Namely,
-Your integration does not have to be exclusively Typescript driven to benefit from this typings repository.
-Some IDEs (e.g. Visual Studio, Visual Studio Code or Sublime Text) can use Typescript typings to provide inline code completion and documentation for plain JavaScript files.
-It is also possible to develop a piecemeal, robust Typescript integration against our services and subsequently incorporate it in a larger JavaScript project. Typescript compiles down to plain JavaScript which can conform to ES3 and later. That output can be exported to other JavaScript projects.
Install package
npm install --save-dev @ideal-postcodes/api-typings
Import interfaces and other definitions
-// E.g. Using the address type to
-import { Address } from "ideal-postcodes-typings";
+ // Import Address type
+import { Address } from "@ideal-postcodes/api-typings";
+
+let address: Address;
+ Typings allow IDEs to provide a richer, more productive environment to develop integrations. This includes providing code completions and suggestions.
+ +Our typings also bear documentation which can be rendered in your IDE as you work.
+ +Compile time checks that your library or application appropriately consumes objects and data types returned by our APIs and client libraries
+Your integration does not have to be exclusively Typescript driven to benefit from this typings repository.
+Some IDEs (e.g. Visual Studio, Visual Studio Code, Sublime Text) use Typescript typings to provide inline code completion and documentation for plain JavaScript files.
+It is also possible to develop a partial, robust Typescript integration against our services and subsequently incorporate it in a larger JavaScript project. Typescript compiles down to plain JavaScript which can conform to ES3 and later. That output can be exported to other JavaScript projects.
The testing process involves attempting to compile a test file which assigns API fixtures generated by the API to the interfaces exported by this typings library. The tests will fail to compile if the API fixtures fail to conform to types.
npm test
@@ -1111,7 +1120,7 @@
AddressResults
AddressSuggestionResults
LicenseesResults
PostcodeResults
Overview
Address
, autocomplete suggestionsAddressSuggestion
, API key statusKeyStatus
)PostcodesResponse
, address autocomplete queriesAddressSuggestionResponse
, address search queriesAddressQueryResponse
)The full documentation for these types can be found at ideal-postcodes.github.io/api-typings.
Typings are exported to
-index.d.ts
when published to npm. The typings in this repository are defined inlib/index.ts
.Benefits of Typings
-This typings repository allows you create Typescript integrations, which gives you the added benefits of static typing. Namely,
--- Compile time checks that your library or application appropriately consumes objects and data types returned by our APIs and client libraries
- - A foundation for IDEs to provide a richer, more productive environment to develop integrations against our HTTP API and client libraries. API typings facilitate code completion, inline documentation and type checking inside of a supported editor
- - The ability to refactor code that integrates against our APIs and client libraries with greater speed and confidence
-
-Non-Typescript Projects
-Your integration does not have to be exclusively Typescript driven to benefit from this typings repository.
-Some IDEs (e.g. Visual Studio, Visual Studio Code or Sublime Text) can use Typescript typings to provide inline code completion and documentation for plain JavaScript files.
-It is also possible to develop a piecemeal, robust Typescript integration against our services and subsequently incorporate it in a larger JavaScript project. Typescript compiles down to plain JavaScript which can conform to ES3 and later. That output can be exported to other JavaScript projects.
Usage
Install package
Import interfaces and other definitions
-
+// E.g. Using the address type to -import { Address } from "ideal-postcodes-typings";
+// Import Address type +import { Address } from "@ideal-postcodes/api-typings"; + +let address: Address;
Links
++- Project Repository
+ - Project Documentation
+ - npm module
+
+Benefits of Typings
+Code Completion
+Typings allow IDEs to provide a richer, more productive environment to develop integrations. This includes providing code completions and suggestions.
+ +Inline Documentation
+Our typings also bear documentation which can be rendered in your IDE as you work.
+ +Type Checking
+Compile time checks that your library or application appropriately consumes objects and data types returned by our APIs and client libraries
+Non-Typescript Projects
+Your integration does not have to be exclusively Typescript driven to benefit from this typings repository.
+Some IDEs (e.g. Visual Studio, Visual Studio Code, Sublime Text) use Typescript typings to provide inline code completion and documentation for plain JavaScript files.
+It is also possible to develop a partial, robust Typescript integration against our services and subsequently incorporate it in a larger JavaScript project. Typescript compiles down to plain JavaScript which can conform to ES3 and later. That output can be exported to other JavaScript projects.
Testing
The testing process involves attempting to compile a test file which assigns API fixtures generated by the API to the interfaces exported by this typings library. The tests will fail to compile if the API fixtures fail to conform to types.
@@ -1112,7 +1121,7 @@npm test
AddressNumber
AddressResults
AddressSuggestionResults
LicenseesResults
PostcodeResults
administrative_county
building_name
building_number
country
county
delivery_point_suffix
department_name
dependant_locality
dependant_thoroughfare
district
double_dependant_locality
eastings
latitude
line_1
line_2
line_3
longitude
northings
organisation_name
po_box
post_town
postal_county
postcode
postcode_inward
postcode_outward
postcode_type
premise
su_organisation_indicator
sub_building_name
thoroughfare
traditional_county
udprn
Optional umprn
ward
code
message
result
hits
limit
page
total
suggestion
udprn
Optional umprn
urls
code
message
result
code
message
hits
enabled
consumed
limit
code
message
result
deleted
limit
allowed_urls
automated_topups
current_purchases
daily_limit
individual_limit
lookups_remaining
notifications
available
address
createdAt
daily
id
key
name
postcode
whitelist
count
limit
updatedAt
code
message
result
code
message
result
address
Optional daily
name
postcode
Optional whitelist
limit
emails
enabled
hasMore
licensees
code
Optional limit
message
Optional page
result
Optional total
code
message
result
code
message
result
consumed
expires
purchased
udprn
Optional umprn
code
message
result
administrative_county
building_name
building_number
country
county
delivery_point_suffix
department_name
dependant_locality
dependant_thoroughfare
district
double_dependant_locality
eastings
latitude
line_1
line_2
line_3
longitude
northings
organisation_name
po_box
post_town
postal_county
postcode
postcode_inward
postcode_outward
postcode_type
premise
su_organisation_indicator
sub_building_name
thoroughfare
traditional_county
udprn
umprn
@@ -1754,7 +1754,7 @@ward
code
message
result