Socket
Socket
Sign inDemoInstall

@ng-web-apis/intersection-observer

Package Overview
Dependencies
Maintainers
4
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ng-web-apis/intersection-observer - npm Package Compare versions

Comparing version 3.2.0 to 4.0.0

classes/safe-observer.d.ts

7

directives/intersection-observee.directive.d.ts

@@ -1,8 +0,7 @@

import { Observable } from 'rxjs';
import { IntersectionObserveeService } from '../services/intersection-observee.service';
import * as i0 from "@angular/core";
export declare class IntersectionObserveeDirective {
readonly waIntersectionObservee: Observable<IntersectionObserverEntry[]>;
constructor(waIntersectionObservee: Observable<IntersectionObserverEntry[]>);
protected readonly waIntersectionObservee: IntersectionObserveeService;
static ɵfac: i0.ɵɵFactoryDeclaration<IntersectionObserveeDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<IntersectionObserveeDirective, "[waIntersectionObservee]", never, {}, { "waIntersectionObservee": "waIntersectionObservee"; }, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<IntersectionObserveeDirective, "[waIntersectionObservee]", never, {}, { "waIntersectionObservee": "waIntersectionObservee"; }, never, never, true, never>;
}

@@ -1,16 +0,12 @@

import { ElementRef, OnDestroy } from '@angular/core';
import type { OnDestroy } from '@angular/core';
import { SafeObserver } from '../classes/safe-observer';
import * as i0 from "@angular/core";
declare const SafeObserver: {
new (callback: IntersectionObserverCallback, options?: IntersectionObserverInit | undefined): IntersectionObserver;
prototype: IntersectionObserver;
};
export declare class IntersectionObserverDirective extends SafeObserver implements OnDestroy {
private readonly callbacks;
constructor(root: ElementRef<Element> | null, rootMargin: string | null, threshold: string | null);
constructor(rootMargin: string | null, threshold: string | null);
observe(target: Element, callback?: IntersectionObserverCallback): void;
unobserve(target: Element): void;
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<IntersectionObserverDirective, [{ optional: true; }, { attribute: "waIntersectionRootMargin"; }, { attribute: "waIntersectionThreshold"; }]>;
static ɵdir: i0.ɵɵDirectiveDeclaration<IntersectionObserverDirective, "[waIntersectionObserver]", ["IntersectionObserver"], {}, {}, never>;
static ɵfac: i0.ɵɵFactoryDeclaration<IntersectionObserverDirective, [{ attribute: "waIntersectionRootMargin"; }, { attribute: "waIntersectionThreshold"; }]>;
static ɵdir: i0.ɵɵDirectiveDeclaration<IntersectionObserverDirective, "[waIntersectionObserver]", ["IntersectionObserver"], {}, {}, never, never, true, never>;
}
export {};
import * as i0 from "@angular/core";
export declare class IntersectionRootDirective {
static ɵfac: i0.ɵɵFactoryDeclaration<IntersectionRootDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<IntersectionRootDirective, "[waIntersectionRoot]", never, {}, {}, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<IntersectionRootDirective, "[waIntersectionRoot]", never, {}, {}, never, never, true, never>;
}

@@ -1,4 +0,1 @@

/**
* Public API Surface of @ng-web-apis/intersection-observer
*/
export * from './directives/intersection-observee.directive';

@@ -5,0 +2,0 @@ export * from './directives/intersection-observer.directive';

@@ -7,4 +7,4 @@ import * as i0 from "@angular/core";

static ɵfac: i0.ɵɵFactoryDeclaration<IntersectionObserverModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<IntersectionObserverModule, [typeof i1.IntersectionObserverDirective, typeof i2.IntersectionObserveeDirective, typeof i3.IntersectionRootDirective], never, [typeof i1.IntersectionObserverDirective, typeof i2.IntersectionObserveeDirective, typeof i3.IntersectionRootDirective]>;
static ɵmod: i0.ɵɵNgModuleDeclaration<IntersectionObserverModule, never, [typeof i1.IntersectionObserverDirective, typeof i2.IntersectionObserveeDirective, typeof i3.IntersectionRootDirective], [typeof i1.IntersectionObserverDirective, typeof i2.IntersectionObserveeDirective, typeof i3.IntersectionRootDirective]>;
static ɵinj: i0.ɵɵInjectorDeclaration<IntersectionObserverModule>;
}
{
"name": "@ng-web-apis/intersection-observer",
"version": "3.2.0",
"version": "4.0.0",
"description": "A library for declarative use of Intersection Observer API with Angular",

@@ -23,15 +23,22 @@ "keywords": [

"peerDependencies": {
"@angular/core": ">=12.0.0",
"@ng-web-apis/common": ">=2.0.0"
"@angular/core": ">=16.0.0",
"@ng-web-apis/common": ">=3.0.6"
},
"main": "bundles/ng-web-apis-intersection-observer.umd.js",
"module": "fesm2015/ng-web-apis-intersection-observer.js",
"es2015": "fesm2015/ng-web-apis-intersection-observer.js",
"esm2015": "esm2015/ng-web-apis-intersection-observer.js",
"fesm2015": "fesm2015/ng-web-apis-intersection-observer.js",
"typings": "ng-web-apis-intersection-observer.d.ts",
"module": "fesm2022/ng-web-apis-intersection-observer.mjs",
"typings": "index.d.ts",
"exports": {
"./package.json": {
"default": "./package.json"
},
".": {
"types": "./index.d.ts",
"esm2022": "./esm2022/ng-web-apis-intersection-observer.mjs",
"esm": "./esm2022/ng-web-apis-intersection-observer.mjs",
"default": "./fesm2022/ng-web-apis-intersection-observer.mjs"
}
},
"sideEffects": false,
"dependencies": {
"tslib": "^2.2.0"
"tslib": "^2.3.0"
}
}
}

@@ -37,15 +37,2 @@ # ![ng-web-apis logo](https://raw.githubusercontent.com/taiga-family/ng-web-apis/main/libs/intersection-observer/logo.svg) Intersection Observer API for Angular

### Usage with Jest
DOM environment provided by Jest does not emulate IntersectionObserver API and need to be mocked. You can add the
following line to your `setup.ts`:
```ts
// setup.ts
import '@ng-web-apis/universal/mocks';
```
to use mocks from [@ng-web-apis/universal](https://github.com/taiga-family/ng-web-apis/tree/main/libs/universal#mocks)
package.
## Examples

@@ -52,0 +39,0 @@

@@ -1,9 +0,7 @@

import { ElementRef } from '@angular/core';
import { Observable } from 'rxjs';
import { IntersectionObserverDirective } from '../directives/intersection-observer.directive';
import * as i0 from "@angular/core";
export declare class IntersectionObserveeService extends Observable<IntersectionObserverEntry[]> {
constructor({ nativeElement }: ElementRef<Element>, observer: IntersectionObserverDirective);
constructor();
static ɵfac: i0.ɵɵFactoryDeclaration<IntersectionObserveeService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<IntersectionObserveeService>;
}

@@ -1,8 +0,11 @@

import { ElementRef } from '@angular/core';
import { Observable } from 'rxjs';
import * as i0 from "@angular/core";
export declare class IntersectionObserverService extends Observable<IntersectionObserverEntry[]> {
constructor({ nativeElement }: ElementRef<Element>, support: boolean, rootMargin: string, threshold: number | number[], root: ElementRef<Element> | null);
static ɵfac: i0.ɵɵFactoryDeclaration<IntersectionObserverService, [null, null, null, null, { optional: true; }]>;
private readonly nativeElement;
private readonly rootMargin;
private readonly threshold;
private readonly root;
constructor();
static ɵfac: i0.ɵɵFactoryDeclaration<IntersectionObserverService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<IntersectionObserverService>;
}

@@ -1,2 +0,3 @@

import { ElementRef, InjectionToken } from '@angular/core';
import type { ElementRef } from '@angular/core';
import { InjectionToken } from '@angular/core';
export declare const INTERSECTION_ROOT: InjectionToken<ElementRef<Element>>;

@@ -1,1 +0,1 @@

export declare function thresholdFactory(threshold: string | null): number | number[];
export declare function thresholdFactory(threshold: string | null): number[] | number;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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