
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@laserfiche/types-lf-ui-components
Advanced tools
This is the type NPM package that contains the declaration files for lf-prefixed elements.
This is the type NPM package that contains the declaration files for lf-prefixed elements.
A declaration file (*.d.ts
) is an interface to the components in the compiled JavaScript. It is similar to a header file (.hpp
) in C++. For example,
export interface ChecklistOption {
name: string;
checked: boolean;
disabled: boolean;
}
A declaration file can also export other declaration files, so it can concatenate all the interfaces together
export * from './lib/lf-checklist.service';
export * from './lib/lf-checklist/lf-checklist.component';
export * from './lib/lf-checklist.module';
export * from './lib/checklist';
export * from './lib/items/checklist-item';
export * from './lib/options/checklist-option';
The laserfiche-ui-components
in CDN is essentially loosely typed JavaScript. For this reason, if an application use elements imported from CDN, it will not have any typing information about those elements. To compliment this, we provide @laserfiche/type-lf-ui-components, a type NPM package that contains the declaration files for those elements.
npm install @laserfiche/type-lf-ui-components
(use the link from the released versions to obtain the NPM package for the desired version)
Import the lf-elements from the CDN by adding this line in ./index.html
inside your application (use the url from the released versions).
<script src="https://unpkg.com/@laserfiche/lf-ui-components@12.0/cdn/lf-ui-components.js" defer></script>
Inside ./app.module.ts
, add CUSTOM_ELEMENTS_SCHEMA
to @NgModule.schemas. This enables custom elements in your Angular application.
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
@NgModule({
declarations: [
AppComponent,
...
],
imports: [
...
],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
example usage of using lf-cheklist
whose implementation is provided in CDN, while type information is provided in the @laserfiche/type-laserfiche-ui-components
NPM package.
In a html file,
<lf-checklist-element #myChecklist (checklistChanged)="onChecklistChangedAsync($event)"></lf-checklist-element>
<!-- checklistChanged is a HTML custom event -->
To add a handle of this element, in the .ts
file,
import { AfterViewInit, Component, ViewChild, ElementRef} from '@angular/core';
// we can directly import types from the NPM package
import {LfChecklistComponent, Checklist} from '@laserfiche/types-laserfiche-ui-components'
@Component({
selector: 'app-attachments',
templateUrl: './attachments.component.html',
styleUrls: ['./attachments.component.css'],
})
export class ExampleApp implements AfterViewInit {
// a handle of the LfCheckistElement in the html above, available after ngAfterViewInit
@ViewChild('myChecklist') componentChecklist!: ElementRef<LfChecklistComponent>;
// type Checklist is the type of the custom element imported from the NPM pakage
currentChecklist: Checklist[];
// event that emits the custom type outputs are dispatched as HTML Custom Events
onClick(event: CustomEvent<Checklist>) {
const checklist = event.detail; // data will be stored in the detail property
}
ngAfterViewInit() {
// the element's view is initialized after ngAfterViewInit
this.componentChecklist.initAsync(...)
}
}
The CDN should work without the type npm package in a non angular application.
FAQs
<!--Copyright (c) Laserfiche. Licensed under the MIT License. See LICENSE in the project root for license information.-->
The npm package @laserfiche/types-lf-ui-components receives a total of 16 weekly downloads. As such, @laserfiche/types-lf-ui-components popularity was classified as not popular.
We found that @laserfiche/types-lf-ui-components demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.