itemconsulting / enonic-types Goto Github PK
View Code? Open in Web Editor NEWTypeScript types for Enonic XP
License: MIT License
TypeScript types for Enonic XP
License: MIT License
lib-cache is a very small library, not with very complex types as I can tell, but for sake of completeness maybe add support for it in enonic-types? What do you think? https://market.enonic.com/vendors/enonic/cache-lib
Hi,
If I use this library to validate Content that is a media-type content it looks like it doesn't except .media.attachment
as something to exist within content.data
. But if you upload an SVG to Content Studio, it stores some data here. Today we bypass this with a @ts-ignore.
import { Content, ContentLibrary } from 'enonic-types/content';
const libContent: ContentLibrary = __non_webpack_require__('/lib/xp/content');
// ...
const attachmentContent: Content = libPortal.getContent<Content>();
log.info(attachmentContent?.data?.media?.attachment); // ts linter doesn't like this row
Is this expected? Maybe I'm using it wrong. I'm using 1.4.0 of this lib, but used 0.0.74 before and recently upgrading didn't solve the problem.
The NPM package @item-enonic-types/[email protected] only contains index.d.ts
which references ./client
and ./document
but they are not packaged in the module. I think this can be easily fixed by adding both files to the package.json files
section
A couple of things:
There is only two functions directly under lib-node: connect
and multiRepoConnect
. The functions get
, delete
, update
etc, should instead be moved into the type of RepoConnection
.
Some of the RepoConnection
functions have either a string or an array of strings as an argument, and depending on what is used, either an object or an array of object is returned. Could this be mirrored in the types?
-ร
MimeType is set to string in Enonic types, while it is object in mail lib.
To be able to create typings we should defined modules that can be looked up in a "typings" folder. Since the paths used by enonic includes slashes (e.g "/lib/xp/content"), maybe we can create aliases without slashes.
displayName can be edited by content.modify, what leads to an error
Cannot assign to 'displayName' because it is a read-only property
Is there any way to solve this now?
Types should be added for lib-util.
If you are looking to contribute to this project, this is a task you can grab. Just comment on this issue that you grabbed it.
What is your thought on adding types for XPs non-abstract built-in content types such as base:shortcut
and base:folder
.
We are encountering them in our code from time to time, and since they aren't generated by the gradle plugin we end up managing/duplicating them ourself, since they follow XP perhaps they could fit in here?
The types of the React4XP library ("/lib/enonic/react4xp"
) should be added to this package. See API Documentation for React4XP
A good start could be the React4XP-types in the Mimir-project.
But the module needs to be declared the same way as all other modules in this project (see HttpLibrary as an example)
Code references to the new module also needs to be added to the following files:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.