Registry / type-stubs / primefaces

primefaces

JSON →
library14.0.0jsnpmunverified

PrimeFaces is a popular open-source UI component library for JavaServer Faces (JSF) with a rich set of over 100 components for enterprise web applications. The npm package 'primefaces' provides TypeScript type definitions for PrimeFaces client-side JavaScript API. Version 14.0.0 is the current stable release as per the given data, but the latest tagged release is 15.0.14. The library has a high release cadence (multiple minor releases per month) and is actively maintained by the PrimeFaces team. Key differentiators include extensive theme support, built-in AJAX, and a large component set. Peer dependencies include hammerjs, component-emitter, keycharm, propagating-hammerjs, and uuid for gesture and event support.

npm install primefaces
INSTALL
IMPORT
SIG · PRIMEFACES
P
primefaces
type-stubsjavascriptv14.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PrimeFaces
import 'primefaces'
const PrimeFaces = require('primefaces')
The 'primefaces' package only provides TypeScript type definitions. Import side-effects to register global types. Do not use require; the package does not export any runtime values.
PF
import 'primefaces'
import { PF } from 'primefaces'
PF is a global function provided by PrimeFaces runtime, not a named export from the types package. Importing 'primefaces' adds type declarations for the global PF object.
PrimeFaces.widget.WidgetName
import 'primefaces'
import { PrimeFaces } from 'primefaces'
PrimeFaces is a global namespace. The types package augments the global scope. Do not attempt named imports.
JQuery
import 'jquery'; import 'primefaces';
import 'primefaces'; import 'jquery';
PrimeFaces type definitions depend on jQuery types. Ensure jQuery type definitions are imported first (or tsconfig includes jQuery).

Demonstrates importing PrimeFaces types, using the global PF function, accessing PrimeFaces settings, making an AJAX request, and calling a widget method.

// Ensure jQuery type definitions are available import 'jquery'; import 'primefaces'; // Use PF global function to get a widget instance const dialog = PF('myDialog'); if (dialog) { dialog.show(); } // Access PrimeFaces settings PrimeFaces.settings.locale = 'en'; // Use PrimeFaces ajax utility PrimeFaces.ajax.AjaxRequest({ url: '/my-endpoint', oncomplete: function(xhr, status, args) { console.log('AJAX complete'); } }); // Use component widget API declare const myAutoComplete: any; // Assume widget var from view myAutoComplete.search('query');
Debug
Known issues
breakingIn PrimeFaces 14+, the type definitions have been restructured. Some component options interfaces have changed.
fix
Review type changes in component options interfaces (e.g., DialogOptions, DataTableOptions). Check migration guide.
affects: >=14.0.0
deprecatedThe 'update' method on widgets is deprecated in favor of 'refresh'.
fix
Replace widget.update() with widget.refresh()
affects: >=13.0.0
gotchaThis package only provides TypeScript type definitions, not the PrimeFaces library itself. You must include the PrimeFaces runtime (JS) separately, typically via a JSF taglib or build.
fix
Include primefaces.jar in your Java web app or use a CDN. The npm types are for client-side type checking only.
affects: *
breakingjQuery dependency upgrade: PrimeFaces 15.0.13 upgraded to jQuery 4.0.0, which may break custom jQuery plugins or older type definitions.
fix
Update jQuery types to version compatible with jQuery 4.0.0 (e.g., @types/jquery@4.x). Test custom scripts.
affects: >=15.0.13
deprecatedThe 'PrimeFaces.widget.DataTable' 'filter' method signature changed; old signature deprecated.
fix
Use the new filter signature: filter(field, value, type) with optional parameters.
affects: >=14.0.0
gotchaThe type definitions rely on global augmentation. If your tsconfig has 'strict: true', you may need to declare global variables like 'PF'.
fix
Add a declaration file (e.g., globals.d.ts) with declare const PF: (id: string) => any; or use a triple-slash directive.
affects: *
breakingPrimeFaces 15.0.11 introduced a breaking change in Datatable/TreeTable column width unit handling with CSS calc() function.
fix
Update column width expressions that use calc() to use the new syntax as per migration notes.
affects: >=15.0.11
Errors
Common errors & fixes
Cannot find name 'PrimeFaces'. Did you mean the module 'primefaces'?
The package does not export PrimeFaces as a named export; it augments the global scope.
fix
Import with side-effect: import 'primefaces'; Then use PrimeFaces as a global.
Cannot find name 'PF'. Do you need to install type definitions for a test runner?
PF is a global function provided by PrimeFaces runtime, not declared in the type definitions unless imported.
fix
Import the primefaces package: import 'primefaces'; This adds global declarations for PF and PrimeFaces.
TypeError: PrimeFaces.ajax.AjaxRequest is not a function
The type definitions are present but the PrimeFaces runtime is not loaded in the browser.
fix
Ensure PrimeFaces JavaScript library is included (e.g., via JSF tag or script tag). The npm types only provide type checking, not the runtime.
Module 'primefaces' resolves to a type-only module. Imported module requires a default import.
The 'primefaces' package has no default export; it's a types-only package.
fix
Use import 'primefaces'; instead of import Something from 'primefaces';.
Upgrade
Version history
14.0.0latest on npm
Audit
Dependencies
@egjs/hammerjsrequiredRequired for gesture/touch event handling in PrimeFaces components
component-emitterrequiredUsed for event emitter pattern in PrimeFaces client-side API
keycharmrequiredManages keyboard shortcuts and key bindings
propagating-hammerjsrequiredEnables event propagation for hammer.js gestures
uuidrequiredGenerates unique identifiers for PrimeFaces components
Agent activity
24 hits · last 30 days
node
22
Amazon
1
OpenAI (training)
1
Resources
primefaces — npm install primefaces · libregistry