Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

enonic-types

Package Overview
Dependencies
Maintainers
1
Versions
179
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enonic-types - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

13

lib/portal.d.ts
import { ByteSource, Content, Site } from "./content";
export interface Component<A> {
readonly path: string;
readonly type: string;
readonly descriptor: string;
readonly config: A;
readonly regions: {
[key: string]: {
components: Array<Component<any>>;
name: string;
};
};
}
export interface PortalLibrary {
getComponent<A>(): Component<A> | null;
getContent<A>(): Content<A> | null;

@@ -4,0 +17,0 @@ getIdProviderKey(): string | null;

2

package.json
{
"name": "enonic-types",
"version": "0.0.5",
"version": "0.0.6",
"description": "TypeScript types for Enonic XP",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -5,1 +5,26 @@ # TypeScript types for Enonic XP

## Example
```typescript
import { Request, Response } from "enonic-types/lib/common";
import { ContentLibrary } from "enonic-types/lib/content";
const contentLib: ContentLibrary = __non_webpack_require__("/lib/xp/content");
export function get(req: Request): Response {
const content = contentLib.get<Article>({ key: req.params.id! });
if (content !== null) {
const article: Article = content.data;
return { status: 200, body: article }
} else {
return { status: 404 };
}
}
interface Article {
readonly title: string;
readonly test: string;
}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc