API Sandbox
Note, this page needs some reorg as soon as APIs get defined more clearly
Hi – human api is a collection of loosely defined JavaScript apis for any kind of device or environment. Purpose of this page is to trigger discussions about APIs we as JavaScript developers would like to see and also broaden the perspective in regards to what APIs we can imagine a browser to have.
Currently we are looking at a very closely defined set of APIs mainly coming from a mobile device context (geolocation, camera, contacts, etc.), really though we can already start discussing JavaScript APIs for other devices (think of medical devices, kitchen devices, etc.).
By starting discussing these types of APIs now we can pave the way for the Web to spread onto other devices than desktop computers and mobile devices.
The examples are by no means definitive, they are just examples to trigger discussion.
Example
appliances.fridge.addEventlistener("empty", function(){
alert("Hey, you better order some drinks!!");
});
API definitions
Human API is trying to collect possible usecases for any types of APIs you would want to be able to access from JavaScript. The usecases are endless and therefore we are trying to collect guidelines for apis you want to create.
Naming conventions
Keep APIs short and consistent
appliances.fridge.temperature.get(succ, err);
And not:
appliances.fridge.temperature.getTemperature(succ, err);
Or maybe this is a better way?
appliances.fridge.temperature(); // Getter appliances.fridge.temperature(decimal); // Setter
These examples just ideas and there might very well be better solutions. Join the discussion in the forum