Comments (4)
As mentioned in #113, we should also ensure that when we infer types for an object literal, we infer the associated JSDoc block.
from deno_doc.
This isn't a defect, it is either a current design limitation and/or feature request, as we do not type inference (e.g. inferred return types, or in this case, object literals. We only document specified type annotations.
from deno_doc.
Correction, we do infer some trivial types for const variables, just not more complex types like object literals.
from deno_doc.
Posting another example from Deno source.
JSDoc is stripped for methods in object literals.
Type Definitions for Deno.env
from lib.deno.ns.d.ts
export const env: {
/** Retrieve the value of an environment variable. Returns `undefined` if that
* key doesn't exist.
*
* ```ts
* console.log(Deno.env.get("HOME")); // e.g. outputs "/home/alice"
* console.log(Deno.env.get("MADE_UP_VAR")); // outputs "undefined"
* ```
* Requires `allow-env` permission. */
get(key: string): string | undefined;
/** Set the value of an environment variable.
*
* ```ts
* Deno.env.set("SOME_VAR", "Value");
* Deno.env.get("SOME_VAR"); // outputs "Value"
* ```
*
* Requires `allow-env` permission. */
set(key: string, value: string): void;
/** Delete the value of an environment variable.
*
* ```ts
* Deno.env.set("SOME_VAR", "Value");
* Deno.env.delete("SOME_VAR"); // outputs "undefined"
* ```
*
* Requires `allow-env` permission. */
delete(key: string): void;
/** Returns a snapshot of the environment variables at invocation.
*
* ```ts
* Deno.env.set("TEST_VAR", "A");
* const myEnv = Deno.env.toObject();
* console.log(myEnv.SHELL);
* Deno.env.set("TEST_VAR", "B");
* console.log(myEnv.TEST_VAR); // outputs "A"
* ```
*
* Requires `allow-env` permission. */
toObject(): { [index: string]: string };
};
Rendered:
from deno_doc.
Related Issues (20)
- Unable to understand import equals
- Deno land not at latest version https://deno.land/x/[email protected]
- Add a mechanism to document type parameters
- Unfriendly error message when the source include missing module specifier (js api)
- deno doc for npm imports
- Dedupe duplicate symbols
- Join symbols with same name as a compound type
- Implement tags
- Add icons
- Implement categories
- Fix sizing and dimensions
- Use tailwind
- dark-mode
- resolve global symbols
- refactor to just use templates
- support mobile
- property drilldown
- Make $ deno doc --html read/resolve .js imports from .ts files if .js files dont exist
- Show default exports HOT 2
- [HTML] Parameters and properties type not added to doc HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deno_doc.